intercom_flutter icon indicating copy to clipboard operation
intercom_flutter copied to clipboard

Lifecycle androidx issue

Open ZoraizDev opened this issue 1 year ago • 4 comments

Screenshot 2024-07-04 at 11 48 42 AM

I tried everything but not resolved.

ZoraizDev avatar Jul 04 '24 07:07 ZoraizDev

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 `

SzymonDziak avatar Jul 07 '24 15:07 SzymonDziak

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 "" is null

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

jpmangoit avatar Jul 09 '24 13:07 jpmangoit

@v3rm0n can we get some assistance please?

SzymonDziak avatar Jul 09 '24 14:07 SzymonDziak

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

deepak786 avatar Jul 10 '24 19:07 deepak786

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

deepak786 avatar Aug 12 '24 22:08 deepak786

Duplicate of https://github.com/v3rm0n/intercom_flutter/issues/436

deepak786 avatar Aug 13 '24 16:08 deepak786