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

fix assembleAndroidTest builds #236

Merged
merged 1 commit into from
Feb 14, 2021
Merged

Conversation

mrbrentkelly
Copy link
Contributor

Fixes an issue when building and running instrumented tests (e.g. Detox) for a React Native project on Android, the following build error was occurring:

* What went wrong:
Execution failed for task ':react-native-zip-archive:mergeExtDexDebugAndroidTest'.
> Could not resolve all files for configuration ':react-native-zip-archive:debugAndroidTestRuntimeClasspath'.
   > Failed to transform zip4j-2.6.4.jar (net.lingala.zip4j:zip4j:2.6.4) to match attributes {artifactType=android-dex, dexing-enable-desugaring=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 DexingNoClasspathTransform: /Users/brent.kelly/.gradle/caches/modules-2/files-2.1/net.lingala.zip4j/zip4j/2.6.4/b1edd95127caa3a6c38b75b092b9c4a3ab91b835/zip4j-2.6.4.jar.
         > Error while dexing.
           The dependency contains Java 8 bytecode. Please enable desugaring by adding the following to build.gradle
           android {
               compileOptions {
                   sourceCompatibility 1.8
                   targetCompatibility 1.8
               }
           }
           See https://developer.android.com/studio/write/java8-support.html for details. Alternatively, increase the minSdkVersion to 26 or above.

If an Android library uses Java 8 language features then it must declare compileOptions in its build.gradle.

...each module that uses Java 8 language features (either in its source code or through dependencies), update the module's build.gradle file, as shown below:

https://developer.android.com/studio/write/java8-support#supported_features

I've seen similar issues crop up in other RN libraries e.g. negativetwelve/react-native-ux-cam#104

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

Successfully merging this pull request may close these issues.

2 participants