App not run on android
I am unable to run the app on Android. The app runs perfectly on Chrome but not on Android.getting errors of kotlin latest version update related. Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from /home/chirag/.gradle/caches/transforms-3/a18e86742e01f373d28c7f0b41fd2e27/transformed/jetified-kotlin-stdlib-1.9.22.jar!/kotlin/Unit.class
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':intercom_flutter:compileReleaseKotlin'.
A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction Compilation error. See log for more details
Getting this error as well-this seems like a huge issue as intercom_flutter flat out doesn't compile on a fresh flutter project 1.22+
@karuna2413 was able to solve this by changing
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
to
id "org.jetbrains.kotlin.android" version "1.9.21" apply false
in android/settings.gradle
After adding this line in settings.gradle: id "org.jetbrains.kotlin.android" version "1.9.21" apply false then running the app results in this error:
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 /home/chirag/.gradle/caches/transforms-3/2d2df7de2d1cd6cb4731a553b01e47e8/transformed/intercom-sdk-15.9.1/META-INF/com/android/build/gradle/aar-metadata.properties (No such file or directory)
@NickTheDev which version of flutter and flutter_intercom you are using?
same issue
Please test the example app and update your gradle version same as the example app.
@deepak786 I tested the example app, and it's working fine. I also updated the Gradle version in my app, but I'm still encountering the same issue.
@deepak786 I tested the example app, and it's working fine. I also updated the Gradle version in my app, but I'm still encountering the same issue.
Same for me
Please test the example app and update your gradle version same as the example app.
@deepak786 You can reproduce the issue by creating the new Flutter project using 3.22.2 version.
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
You can reproduce the issue by creating the new Flutter project using 3.24.0 version.
It's not working for me still getting an Error.