Lifecycle androidx issue
I tried everything but not resolved.
I have same issue. Had to literally break my entire project apart to find out its intercom_flutter package issue.
`ERROR:/Users/szymondziak/.gradle/caches/transforms-3/f6bcea4b0cee2026560f7193f25e3c23/transformed/lifecycle-livedata-core-2.8.1-runtime.jar: R8: java.lang.NullPointerException
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:minifyReleaseWithR8'.
A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable `
intercom_flutter version:9.0.3
getting same issue:
ERROR:/home/chirag/.gradle/caches/transforms-3/c89e8286f3ae82fd05d8aa9b79aa2b07/transformed/lifecycle-livedata-core-2.8.1-runtime.jar: D8: java.lang.NullPointerException: Cannot invoke "String.length()" because "
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:mergeExtDexDebug'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform lifecycle-livedata-core-2.8.1.aar (androidx.lifecycle:lifecycle-livedata-core:2.8.1) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}. > Execution failed for DexingWithClasspathTransform: /home/chirag/.gradle/caches/transforms-3/c89e8286f3ae82fd05d8aa9b79aa2b07/transformed/lifecycle-livedata-core-2.8.1-runtime.jar. > Error while dexing.
- 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 9s Running Gradle task 'assembleDebug'... 9.6s Error: Gradle task assembleDebug failed with exit code 1
@v3rm0n can we get some assistance please?
Seems like a duplicate of https://github.com/v3rm0n/intercom_flutter/issues/436.
Please test the example app and update your gradle version same as the example app. https://github.com/v3rm0n/intercom_flutter/issues/436#issuecomment-2146614948
You need to use AGP version 8. Please follow the below steps:
- android/app/build.gradle Make sure to add the following under android section
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
- android/gradle/wrapper/gradle-wrapper.properties Update your distributionUrl
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
- android/settings.gradle
id "com.android.application" version "8.1.4" apply false
id "org.jetbrains.kotlin.android" version "1.9.21" apply false
For ref see this commit: https://github.com/v3rm0n/intercom_flutter/commit/6cd517bf146b88e49e22b4ebe9588dcdce02e918
Duplicate of https://github.com/v3rm0n/intercom_flutter/issues/436