Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle Build Failed: NullPointerException in error_prone_annotations-2.36.0.jar during Dexing

'm facing an issue while building my Android project with Gradle. The build fails with a NullPointerException related to error_prone_annotations-2.36.0.jar. Here’s the full error message:

ERROR: C:\Users\habib\.gradle\caches\transforms-3\e646cb792b71c76b98054fc8aca82c16\transformed\jetified-error_prone_annotations-2.36.0.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 error_prone_annotations-2.36.0.jar (com.google.errorprone:error_prone_annotations:2.36.0) 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.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}. Execution failed for DexingWithClasspathTransform: C:\Users\habib.gradle\caches\transforms-3\e646cb792b71c76b98054fc8aca82c16\transformed\jetified-error_prone_annotations-2.36.0.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.

BUILD FAILED in 1m 40s Error: Gradle task assembleDebug failed with exit code 1

like image 222
Mohamed Hesham Avatar asked Oct 31 '25 11:10

Mohamed Hesham


1 Answers

Add this code to ignore all errorprone.. add it in android/build.gradle inside allprojects

 configurations.all {
    exclude group: "com.google.errorprone", module: "error_prone_annotations"
}
like image 154
George Mushi Avatar answered Nov 03 '25 01:11

George Mushi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!