Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execution failed for task ':permission_handler:compileDebugJavaWithJavac'. FLUTTER

Tags:

flutter

dart

I am new to Flutter and I am stuck at these errors.When i use

compileSdkVersion 30

this error appears

Execution failed for task ':geolocator_android:compileDebugJavaWithJavac'

and when i use

compileSdkVersion 31

above error disappear and we got this error

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)

like image 959
Muhammad Shafique Avatar asked May 09 '26 12:05

Muhammad Shafique


1 Answers

Use App->Build Gradle


minSdkVersion 21 targetSdkVersion 31


android {
    compileSdkVersion 31

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.eos.asd"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode 2
        versionName '1.02'
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}
like image 106
Tasnuva Tavasum oshin Avatar answered May 11 '26 05:05

Tasnuva Tavasum oshin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!