我刚接触Flutter,现在遇到了一些错误。当我使用
compileSdkVersion 30
出现了这个错误
Execution failed for task ':geolocator_android:compileDebugJavaWithJavac'
当我使用时
compileSdkVersion 31
之前的错误已经消失,我们得到了这个错误
Execution failed for task ':permission_handler:compileDebugJavaWithJavac'.
Launching lib\main.dart on SM A515F in debug mode...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Parameter format not correct -
Note: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-11.2.4\android\src\main\java\io\flutter\plugins\firebase\messaging\JobIntentService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\geocoding-2.0.1\android\src\main\java\com\baseflow\geocoding\GeocodingPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-6.1.3\android
\src\main\java\com\baseflow\permissionhandler\ServiceManager.java:152:
warning: [deprecation] getDefaultAdapter() in BluetoothAdapter has been deprecated
final BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
^
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':permission_handler:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4m 49s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)