Skip to content

Android androidTest build fails with duplicate Hermes JNI libs (libhermestooling.so / libhermesvm.so) on RN 0.83.1 #267

@Overtorment

Description

@Overtorment

Hi! Thanks for the great library.

We’re seeing an Android test-build failure (Detox / androidTest) with react-native-worklets-core@1.6.2 due to duplicate native libs during merge.

Environment

  • react-native-worklets-core: 1.6.2
  • react-native: 0.83.1
  • Gradle: 9.0.0 (wrapper)
  • Android NDK: 27.1.12297006
  • OS: Linux

Repro

In a RN app with Detox enabled, run a debug android test build (for us this is via npm run e2e:debug-build).

Fails at:

  • :react-native-worklets-core:mergeDebugAndroidTestNativeLibs

Error

Initially:

2 files found with path 'lib/arm64-v8a/libhermestooling.so' from inputs:
- .../node_modules/react-native-worklets-core/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libhermestooling.so
- .../.gradle/caches/.../jetified-react-android-0.83.1-debug/jni/arm64-v8a/libhermestooling.so

After excluding that one, next duplicate is:

2 files found with path 'lib/arm64-v8a/libhermesvm.so' from inputs:
- .../node_modules/react-native-worklets-core/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libhermesvm.so
- .../.gradle/caches/.../jetified-hermes-android-0.14.0-debug/jni/arm64-v8a/libhermesvm.so

Current workaround

In react-native-worklets-core/android/build.gradle under packagingOptions.excludes, adding:

"**/libhermestooling.so",
"**/libhermesvm.so",

fixes the issue for us. After this, both:

  • :react-native-worklets-core:mergeDebugAndroidTestNativeLibs
  • full Detox debug build

succeed.

Request

Would you consider adding these excludes upstream (or otherwise adjusting packaging) so androidTest/Detox builds work out of the box on RN 0.83.x?

Happy to provide more logs or test a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions