Description
I keep getting the error below when running detox build -c android
> Task :app:packageDebugAndroidTest FAILEDFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:packageDebugAndroidTest'.> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade> Entry name 'META-INF/MANIFEST.MF' collided
Reproduce
- Go through the steps here to set up detox for android (without the test butler step)
- Set up the 2 following files as described
- Run
detox build -c android
(with or without having built the aosp emulator first).detoxrc.json
{ ..."android": {"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk","build": "cd android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug && cd ..","type": "android.emulator","device": {"avdName": "Pixel_API_28_AOSP" } } ...
android/app.build.gradle
The first 3 options are failed attempts at fixing the issue. The last option was already present in the project before trying to install Detox.
android { ... packagingOptions { // exclude 'META-INF/**' // pickFirst 'META-INF/**' // merge 'META-INF/**' pickFirst "**" } ...}
Environment
- Detox: ^17.14.3
- React Native: 0.63.2
- Node: v12.19.0
- Device: Android AOSP Pixel Emulator API 28
- OS: MacOS Catalina v10.15.7
- Test-runner: jest
Other potentially useful info
- Detox builds and runs tests fine for iOS, but not android
- Running the build command with
--stacktrace
doesn't give any further info - This is my first time trying to set up detox at all on this project
- The solution listed in the detox docs hasn't fixed it
- Lots of stuff I've found about related errors on threads (though none mention detox) has to do with the gradle version. A lot of people suggest downgrading.
- I can build the actual app on a normal Pixel emulator and the AOSP one using the build command through android studio. This issue only occurs when trying to use the build command through
detox-cli