Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while dexing: Cannot invoke "String.length()" because "<parameter1>" is null #37

Open
DeborahAnn032 opened this issue Nov 6, 2023 · 3 comments

Comments

@DeborahAnn032
Copy link

DeborahAnn032 commented Nov 6, 2023

I am using HtmlUnit on my android project:

    implementation group: 'org.htmlunit', name: 'htmlunit3-android', version: '3.7.0'

However this is the exception during build for jettified-commons-text-1.11.0.jar:

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

and for jettified-commons-io-2.15.0.jar:

Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform commons-text-1.11.0.jar (org.apache.commons:commons-text:1.11.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=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /Users/saverio/.gradle/caches/transforms-3/154b59ed198ece14418a8a75c0024e97/transformed/jetified-commons-text-1.11.0.jar.
         > Error while dexing.
   > Failed to transform commons-io-2.15.0.jar (commons-io:commons-io:2.15.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=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /Users/saverio/.gradle/caches/transforms-3/7275a725efaeb4397c8cb51be3af2f02/transformed/jetified-commons-io-2.15.0.jar.
         > Error while dexing.
@rbri
Copy link
Member

rbri commented Nov 8, 2023

you can safely overwrite this two dependencies and use the old ones - the new version does not use anything that is only available in the new ones.

@wuwbobo2021
Copy link

For slint-ui/slint#4973, I've tested Android build tools 34.0.0 and 35.0.0 with platform 30 under JDK 21, the D8 from version 35.0.0 built the dex file successfully. With build tools 34.0.0, the result is the same: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null.

@rbri
Copy link
Member

rbri commented Jan 2, 2025

The runtime dependency to commons-text will be removed in version 4.8.0. For the commons-io you have to use commons-io 2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants