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