I recently update the gradle version of my project. And along with that I had to update the kotlin version. However when I run assembleRelease
, I keep getting multiple warnings saying,
WARNING: D8: An error occurred when parsing kotlin metadata. This normally happens when using a newer version of kotlin than the kotlin version released when this version of R8 was created. To find compatible kotlin versions, please see: https://developer.android.com/studio/build/kotlin-d8-r8-versions
WARNING: D8: Unexpected error during rewriting of Kotlin metadata for class 'com.google.firebase.analytics.ktx.ktxtesting.TestingKt':
com.android.tools.r8.internal.A10: Should never be called
This is my project level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.6'
}
}
plugins {
id 'com.android.application' version '8.1.4' apply false
id 'com.android.library' version '8.1.4' apply false
id 'org.jetbrains.kotlin.android' version '1.9.10' apply false
id 'com.google.gms.google-services' version '4.4.2' apply false
id 'com.google.firebase.crashlytics' version '3.0.2' apply false
}
and my gradle-wrapper.properties
file looks like this
distributionBase=GRADLE_USER_HOME
distributionUrl=https://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
I also referred to https://developer.android.com/build/kotlin-support and it seems the versions shouldn’t be incompatible based on the information provided.
I am getting the above warnings only for com.google.firebase.analytics
.
Any assistance to solve this will be greatly appreciated.
2
Upgrading AGP to the latest version (which at the time of writing is 8.6.0
) fixed this issue (see the question comments above).