flutter_local_notifications icon indicating copy to clipboard operation
flutter_local_notifications copied to clipboard

core library desugaring to be enabled

Open hassony105 opened this issue 5 months ago • 4 comments

Hello, I have this problem:

Launching lib\main.dart on 23106RN0DA in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > An issue was found when checking AAR metadata:

       1.  Dependency ':flutter_local_notifications' requires core library desugaring to be enabled
           for :app.

           See https://developer.android.com/studio/write/java8-support.html for more
           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 21s
Error: Gradle task assembleDebug failed with exit code 1

even i have enabled core library desugaring. this is flutter_local_notifications build.gradle:

group 'com.dexterous.flutterlocalnotifications'
version '1.0-SNAPSHOT'

buildscript {
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:8.6.0'
    }
}

rootProject.allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

apply plugin: 'com.android.library'

android {
    namespace 'com.dexterous.flutterlocalnotifications'
    compileSdk 34
    compileOptions {
        coreLibraryDesugaringEnabled true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        multiDexEnabled true
        minSdkVersion 16
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    lintOptions {
        disable 'InvalidPackage'
    }
}

dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
    implementation "androidx.core:core:1.3.0"
    implementation "androidx.media:media:1.1.0"
    implementation "com.google.code.gson:gson:2.8.9"

    testImplementation 'junit:junit:4.12'
    testImplementation 'org.mockito:mockito-core:3.10.0'
    testImplementation 'androidx.test:core:1.2.0'
    testImplementation "org.robolectric:robolectric:4.7.3"
}

I have been tried to sync build with android folder project but there are no errors!

> Task :prepareKotlinBuildScriptModel UP-TO-DATE

BUILD SUCCESSFUL in 1s

flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.24.2, on Microsoft Windows [Version 10.0.22631.4037], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.10.1)
[√] Android Studio (version 2024.1)
[√] VS Code (version 1.92.1)
[√] Connected device (4 available)
[√] Network resources

• No issues found!

hassony105 avatar Sep 10 '24 06:09 hassony105