Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Android build fails for AndroidTest with processDebugAndroidTestManifest FAILED w/ RN 0.69.7 #110

Open
killuhwhale opened this issue Feb 22, 2023 · 8 comments

Comments

@killuhwhale
Copy link

killuhwhale commented Feb 22, 2023

I'm trying to use Detox for e2e tests and have failed to setup Detox with my project.
I keep getting a build failure regarding react-native-encrypted-storage when running the gradle assembleAndroidTest command.

I execute:
detox build --configuration android.emu.debug
which executes:
./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug

Versions:
"react-native": "0.69.7",
"react-native-encrypted-storage": "^4.0.3",

The following command fails:
./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug

With the following message:

Task :react-native-encrypted-storage:processDebugAndroidTestManifest FAILED
/home/killuh/ws_p38/fitform/FitForm/node_modules/react-native-encrypted-storage/android/build/intermediates/tmp/manifest/androidTest/debug/tempFile1ProcessTestManifest11953716120453094683.xml:27:9-33:20 Error:
android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
/home/killuh/ws_p38/fitform/FitForm/node_modules/react-native-encrypted-storage/android/build/intermediates/tmp/manifest/androidTest/debug/tempFile1ProcessTestManifest11953716120453094683.xml:34:9-40:20 Error:
android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
/home/killuh/ws_p38/fitform/FitForm/node_modules/react-native-encrypted-storage/android/build/intermediates/tmp/manifest/androidTest/debug/tempFile1ProcessTestManifest11953716120453094683.xml:41:9-47:20 Error:
android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

FAILURE: Build failed with an exception.
The following commands work to build the app on emulator or physical device:
npx react-native run-android
cd android/ && ./gradlew clean && ./gradlew bundleRelease && cd .. && npx react-native run-android --variant=release

However, ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug continues to fail.

Any help would be greatly appreciated, thanks!

Edit: For anyone else that may run into this issue, I used rn-secure-storage instead, which solved the issue and took 2 mins.

@killuhwhale killuhwhale changed the title Task :react-native-encrypted-storage:processDebugAndroidTestManifest FAILED Android build fails for AndroidTest with processDebugAndroidTestManifest FAILED w/ RN 0.69.7 Feb 23, 2023
@mfelix5
Copy link

mfelix5 commented Mar 6, 2023

I have the same issue with detox v18.1.0, react-native v.70.6 and react-native-encrypted-storage v4.0.2. Any feedback would be appreciated. I would prefer NOT to change storage libraries. Thank you!

@yannick-softwerft
Copy link

+1

@px-amaac
Copy link

px-amaac commented Mar 13, 2023

There are no activities in the library that I could find. I think this error refers to an outdated test library.
I had this issue. Working after upgrading 'androidx.test.ext:junit' to version '1.1.5'.

androidTestImplementation 'androidx.test.ext:junit:1.1.5'

In libraries build.gradle folder.

@mfelix5
Copy link

mfelix5 commented Mar 14, 2023

@px-amaac could you clarify exactly where you have added this line to fix the issue? In my case, adding androidTestImplementation 'androidx.test.ext:junit:1.1.5' in android/app/build.gradle under dependencies before or after the androidTestImplementation('com.wix:detox:+') line does NOT change the behavior for me.

@mfelix5
Copy link

mfelix5 commented Mar 14, 2023

Actually, @px-amaac , I now understand what you found. The required update is in the build.gradle file in node_modules/react-native-encrypted-storage/android.

@mfelix5
Copy link

mfelix5 commented Mar 14, 2023

Here is the open PR: #81

@mfelix5
Copy link

mfelix5 commented Apr 20, 2023

Here is a new PR that solves this issue: #115

@emil-malmgaard-rasmussen

Can we get the PR merged? My android build is failing as well, I'm on RN 72

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants