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

Can't add react-native-skia to project with detox tests. Android. #728

Closed
limpbrains opened this issue Aug 2, 2022 · 3 comments
Closed

Comments

@limpbrains
Copy link

After adding react-native-skia, I'm trying to build app with
npx detox build --configuration android.debug
or
./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug

And I'm having this error:

> Task :shopify_react-native-skia:mergeDebugAndroidTestJavaResource FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':shopify_react-native-skia:mergeDebugAndroidTestJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 21 files found with path 'META-INF/MANIFEST.MF' from inputs:
      - /Users/limpbrains/.gradle/caches/transforms-3/c7a3d8e754417ee7f18d6f844ca21597/transformed/jetified-infer-annotation-0.18.0.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/28f90025cf0e02f127d76b41c76d62fb/transformed/jetified-jsr305-3.0.2.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/3a3e2162fdef4df1dfc8c1c631a25eb2/transformed/jetified-kotlin-annotations-jvm-1.3.72.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/0325b3a0f84ff4344ca0c812992822a6/transformed/jetified-proguard-annotations-1.19.0.jar
      - /Users/limpbrains/.gradle/caches/modules-2/files-2.1/androidx.collection/collection/1.0.0/42858b26cafdaa69b6149f45dfc2894007bc2c7a/collection-1.0.0.jar
      - /Users/limpbrains/.gradle/caches/modules-2/files-2.1/androidx.arch.core/core-common/2.0.0/bb21b9a11761451b51624ac428d1f1bb5deeac38/core-common-2.0.0.jar
      - /Users/limpbrains/.gradle/caches/modules-2/files-2.1/androidx.lifecycle/lifecycle-common/2.0.0/e070ffae07452331bc5684734fce6831d531785c/lifecycle-common-2.0.0.jar
      - /Users/limpbrains/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation/1.1.0/e3a6fb2f40e3a3842e6b7472628ba4ce416ea4c8/annotation-1.1.0.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/026342ae077f35e9246234f828f9b1fc/transformed/jetified-soloader-0.10.3/jars/classes.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/e01963f44d0f52b55b6cac6f0c146899/transformed/jetified-annotation-0.10.3.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/09c6e017707801a8f8f0a058eab1d4a8/transformed/jetified-fbjni-java-only-0.2.2.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/cd76cbdbb5842edb847457ea711d6123/transformed/jetified-nativeloader-0.10.3.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/b2505c54dd4a699b120b6d3ecb80dfb5/transformed/jetified-bolts-tasks-1.4.0.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/fdfccbc50e205c7c65002b19f1728cf8/transformed/jetified-okhttp-urlconnection-4.9.2.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/623fe1730669c9bf90f685123af3ce0b/transformed/jetified-okhttp-4.9.2.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/1575b134a98438f9ef676c1497ebbef9/transformed/jetified-okio-jvm-2.9.0.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/2e04cb63e9a30bd6ebad1459f6418cb7/transformed/jetified-kotlin-stdlib-jdk8-1.4.10.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/3f71b002e920dd9b2a9476a7ae42c517/transformed/jetified-kotlin-stdlib-jdk7-1.4.10.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/73aa7b46042ca057601ce60d335f2a2d/transformed/jetified-kotlin-stdlib-1.4.10.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/91aa3cec73d4fc3e58f1af3c82980e18/transformed/jetified-kotlin-stdlib-common-1.4.10.jar
      - /Users/limpbrains/.gradle/caches/transforms-3/fd106bbac1f3baf92ce7f0ed2c9d40e9/transformed/jetified-annotations-13.0.jar
     Adding a packagingOptions block may help, please refer to
     https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
     for more information

* 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.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 4m 39s

"react-native": "0.68.2",
"@shopify/react-native-skia": "0.1.124",

I also tried last one, same error.

You can reproduce this issue with https://github.com/BlueWallet/BlueWallet repo.

  • install @shopify/react-native-skia
  • run npx detox build --configuration android.debug
@supriyoMondal
Copy link

any solutions ?

@AbijahKaj
Copy link

AbijahKaj commented Aug 31, 2022

You need to add this to your build.gradle file under the android/app folder:

android{
// some other configurations
// ...

   packagingOptions {
        excludes = [
                "META-INF/**",
        ]
    }
}

If this doesn't solve the issue, you may additionally need to patch the package causing the issue in the node_modules feature by doing the same procedure.

@limpbrains
Copy link
Author

Thank you! That helped

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