Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'flutter_local_notifications' requires core library desugaring to be enabled for app #2286

Closed
hafeezrana opened this issue Mar 30, 2024 · 12 comments

Comments

@hafeezrana
Copy link

hafeezrana commented Mar 30, 2024

when I run the app. It crashes .
where as the compatible versions are

  • flutter_local_notifications: 17.0.0

  • ext.kotlin_version = '1.8.0'

  • compileSdkVersion 34

  • minSdkVersion 26

  • targetSdkVersion 34

  • Flutter Version : 3.19.3

Console Output:
Screenshot 2024-03-30 at 11 43 10 PM

@khalidrinaldy
Copy link

have you fix this issue?

@hafeezrana
Copy link
Author

have you fix this issue?

not yet. Still facing the same .

@Silfalion
Copy link

have the same issue

@Silfalion
Copy link

Check this https://pub.dev/packages/flutter_local_notifications#gradle-setup

You need to add a compile option as well as a dependency for the the desugaring core library

@khalidrinaldy
Copy link

I added on build.gradle:app like

`compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17

    // add this code
    coreLibraryDesugaringEnabled true
}`

`dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:30.4.1')
implementation 'com.google.firebase:firebase-analytics'

// add these codes
// you can upgrade the window library too
implementation 'androidx.window:window:1.0.0'
implementation 'androidx.window:window-java:1.0.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'

}`

this solved my issue

@hafeezrana
Copy link
Author

I added on build.gradle:app like

`compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17

    // add this code
    coreLibraryDesugaringEnabled true
}`

`dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation platform('com.google.firebase:firebase-bom:30.4.1') implementation 'com.google.firebase:firebase-analytics'

// add these codes
// you can upgrade the window library too
implementation 'androidx.window:window:1.0.0'
implementation 'androidx.window:window-java:1.0.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'

}`

this solved my issue

@agelospanagiotakis
Copy link

i will try these solutions as i am still not able to compile correctly for google to accept my app
anyhow the documentation should be updated for clarity

@ITApexGroup
Copy link

I added on build.gradle:app like

`compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17

    // add this code
    coreLibraryDesugaringEnabled true
}`

`dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation platform('com.google.firebase:firebase-bom:30.4.1') implementation 'com.google.firebase:firebase-analytics'

// add these codes
// you can upgrade the window library too
implementation 'androidx.window:window:1.0.0'
implementation 'androidx.window:window-java:1.0.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'

}`

this solved my issue

Screenshot 2024-10-25 at 14 45 37 How to add coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2' and coreLibraryDesugaringEnabled true my file

@khairulanas
Copy link

I added on build.gradle:app like

`compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17

    // add this code
    coreLibraryDesugaringEnabled true
}`

`dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation platform('com.google.firebase:firebase-bom:30.4.1') implementation 'com.google.firebase:firebase-analytics'

// add these codes
// you can upgrade the window library too
implementation 'androidx.window:window:1.0.0'
implementation 'androidx.window:window-java:1.0.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'

}`

this solved my issue

thanks, it works:
image

@Levi-Lesches
Copy link
Contributor

Updated docs are temporarily here, see #2477 for progress

@saranshane
Copy link

I added on build.gradle:app like

`compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17

    // add this code
    coreLibraryDesugaringEnabled true
}`

`dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation platform('com.google.firebase:firebase-bom:30.4.1') implementation 'com.google.firebase:firebase-analytics'

// add these codes
// you can upgrade the window library too
implementation 'androidx.window:window:1.0.0'
implementation 'androidx.window:window-java:1.0.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'

}`

this solved my issue

This One Works

@iamraghavan
Copy link

Yeah, it's Buddy's @MaikuB who can fix this officially, or the Flutter official team can fix this natively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants