Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null

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:\Users\John Doe\.gradle\caches\transforms-3\a17cb0bdbb9802eb5b30084992aad901\transformed\jetified-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:\Users\John Doe\.gradle\caches\transforms-3\cb6538e8f72401bf3ec35fdf09737324\transformed\appcompat-1.7.0-beta01-runtime.jar.
          Error while dexing.

enter image description here

enter image description here

enter image description here

Any ideas on what could be wrong?

like image 325
Lechucico Avatar asked Jan 17 '26 21:01

Lechucico


2 Answers

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:

configurations.all {
        resolutionStrategy {
            force("androidx.core:core-ktx:1.9.0")
        }
    }
like image 109
Programmer007 Avatar answered Jan 19 '26 15:01

Programmer007


No. No. No.

Only the new versions of Android Studio with a service pack magically correct these moronic, incomprehensible errors!

No need to build a garden - adding even more garbage to the project!

Only new versions of Android Studio miraculously fix such errors!

like image 33
user_MGU Avatar answered Jan 19 '26 15:01

user_MGU



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!