assembleAndroidTest doesn't use packagingOptions

Hi everyone,

I’m trying to build Detox tests for ReactNative project for android and it’s throwing this error

> Task :react-native-pdf:transformNativeLibsWithMergeJniLibsForDebugAndroidTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-pdf:transformNativeLibsWithMergeJniLibsForDebugAndroidTest'.
> More than one file was found with OS independent path 'lib/x86/libc++_shared.so'

After doing some research adding this block of code in app/build.gradle should’ve helped

android {
    packagingOptions {
          pickFirst '**/libjsc.so'
          pickFirst '**/libc++_shared.so'
   }
}

However for some reason, gradlew assembleAndroidTest is not using the packagingOptions to build
resulting in the More than one file was found with OS independent path 'lib/x86/libc++_shared.so error.

Anyone knows how I can run gradlew assembleAndroidTest that uses packagingOptions ?

1 Like

Having same issue. Did you figure this out?

same issue detox with react-native-pdf any resolution> @daveyleo

Guys,

I am facing same issue with Detox. Can someone please suggest a quick work around as my application is currently planned to be deployed in production?

Thanks a lot