My react native app (RN 0.71, AGP 7.3.1, Gradle 7.5) compiled on android without issues last week. This week when trying to compile again without making any changes to the code and the machine i get the following error :
Task :app:mergeExtDexDebug FAILED
w: Detected multiple Kotlin daemon sessions at kotlin/sessions
ReactNativeFirebase WARNING: NPM package '@react-native-firebase/remote-config' depends on '@react-native-firebase/app' v20.4.0 but found v20.5.0, this might cause build issues or runtime crashes.
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.5.aar (androidx.lifecycle:lifecycle-livedata-core:2.8.5) 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=23, 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: /Users/ilan/.gradle/caches/transforms-3/2243e9842db10273373fb2f331f55239/transformed/lifecycle-livedata-core-2.8.5-runtime.jar.
> Error while dexing.
Failed to transform lifecycle-livedata-core-2.8.5.aar (androidx.lifecycle:lifecycle-livedata-core:2.8.5) 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=23, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for DexingWithClasspathTransform: /Users/ilan/.gradle/caches/transforms-3/2243e9842db10273373fb2f331f55239/transformed/lifecycle-livedata-core-2.8.5-runtime.jar.
> Error while dexing.
This is my current build.gradle file :
buildscript {
ext {
buildToolsVersion = "35.0.0"
minSdkVersion = 23
compileSdkVersion = 34
targetSdkVersion = 35
RNMapboxMapsImpl = "mapbox" // required for v10
kotlinVersion = '1.9.0'
ndkVersion = "26.1.10909125"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath 'com.google.gms:google-services:4.3.15'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
username = 'mapbox'
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
}
}
maven {
// react-native-background-fetch
url("${project(':react-native-background-fetch').projectDir}/libs")
}
}
}
w: Detected multiple Kotlin daemon sessions at kotlin/sessionsmight./gradlew —stopfix your problem.