Today I was not able to compile my application. This is the error that I obtain if I try to Rebuild my project.
java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null
Execution failed for task ':app:dexBuilderDebug'.
Could not resolve all files for configuration ':app:detachedConfiguration18'.
Failed to transform jetified-appcompat-resources-1.7.0-beta01-runtime.jar to match attributes {artifactType=ext-dex-dexBuilderDebug, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
Execution failed for DexingExternalLibArtifactTransform: C:UsersJohn Doe.gradlecachestransforms-3a17cb0bdbb9802eb5b30084992aad901transformedjetified-appcompat-resources-1.7.0-beta01-runtime.jar.
Error while dexing.
Failed to transform appcompat-1.7.0-beta01-runtime.jar to match attributes {artifactType=ext-dex-dexBuilderDebug, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
Execution failed for DexingExternalLibArtifactTransform: C:UsersJohn Doe.gradlecachestransforms-3cb6538e8f72401bf3ec35fdf09737324transformedappcompat-1.7.0-beta01-runtime.jar.
Error while dexing.
Any ideas on what could be wrong?
3
Answers
I solved it by upgrading to gradle 8 using the automatic version updater. Then you’ll have to fix a few more cascading bugs that are minor tweaks to the build.gradle and manifest.xml. Keep commenting and I’ll let you know.
I added following code in app build.gradle after reviewing error details. Details were as following
Could not resolve all files for configuration ‘:app:stagingDebugRuntimeClasspath’. > Failed to transform core-1.14.0-alpha01.aar (androidx.core:core:1.14.0-alpha01) to match attributes.
Possible Fix:
On our side, the problem comes from the "react-native-google-fit" package which uses the latest version of appcompat in android/build.gradle:
The latest version 1.7.0-beta01 seems to be causing problems with our build configuration.
While waiting to find the solution, I made this temporary patch, just replace react-native-google-fit in your package.json:
"react-native-google-fit": "0.20.0" by "react-native-google-fit": "IlanAMG/react-native-google-fit"
(https://github.com/IlanAMG/react-native-google-fit)
run yarn and it works.
Follow the same method on the problematic package on your side or in your android/build.gradle
This is just a temporary patch for today