Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task :app:processDebugAndroidTestManifest FAILED Error for Android Build with Detox #4082

Closed
1 of 2 tasks
abajajct opened this issue May 22, 2023 · 6 comments
Closed
1 of 2 tasks

Comments

@abajajct
Copy link

abajajct commented May 22, 2023

What happened?

When I run the detox build command for android I get the below error

 % detox build --configuration android.emu.debug --debug
cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug


> Configure project :react-native-flipper
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

> Configure project :react-native-quick-base64
react-native-quick-base64: node_modules/ found at: /Users/<username>/repos/<repo_name>/node_modules

> Configure project :react-native-reanimated
AAR for react-native-reanimated has been found
/Users/<username>/repos/<repo_name>/node_modules/react-native-reanimated/android/react-native-reanimated-71-hermes.aar

> Task :app:processDebugAndroidTestManifest FAILED
/Users/<username>/repos/<repo-name>/app/<app_name>/android/app/build/intermediates/tmp/manifest/androidTest/debug/tempFile1ProcessTestManifest4246039871275064926.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.
/Users/<username>/repos/<repo-name>/app/<app_name>/android/app/build/intermediates/tmp/manifest/androidTest/debug/tempFile1ProcessTestManifest4246039871275064926.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.
/Users/<username>/repos/<repo-name>/app/<app_name>/android/app/build/intermediates/tmp/manifest/androidTest/debug/tempFile1ProcessTestManifest4246039871275064926.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 https://developer.android.com/r/studio-ui/build/manifest-merger for more information about the manifest merger.


FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugAndroidTestManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 16s
716 actionable tasks: 21 executed, 695 up-to-date


Important: 'detox build' is a convenience shortcut for calling your own build command, as provided in the config file.
Failures in this build command are not the responsibility of Detox. You are responsible for maintaining this command.

Command failed: cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug

What was the expected behaviour?

No response

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: 20.9
React Native version: 0.71.8
Has Fabric (React Native's new rendering system) enabled: (yes/no) no
Node version: 16.20.0
Device model: Emulator
Android version:
Test-runner (select one): jest / other jest

Detox logs

Detox logs
% detox build --configuration android.emu.debug --debug
cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug

> Configure project :react-native-flipper
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

> Configure project :react-native-quick-base64
react-native-quick-base64: node_modules/ found at: /Users/<username>/repos/<repo_name>/node_modules

> Configure project :react-native-reanimated
AAR for react-native-reanimated has been found
/Users/<username>/repos/<repo_name>/node_modules/react-native-reanimated/android/react-native-reanimated-71-hermes.aar

> Task :app:processDebugAndroidTestManifest FAILED
/Users/<username>/repos/<repo-name>/app/<app_name>/android/app/build/intermediates/tmp/manifest/androidTest/debug/tempFile1ProcessTestManifest4246039871275064926.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.
/Users/<username>/repos/<repo-name>/app/<app_name>/android/app/build/intermediates/tmp/manifest/androidTest/debug/tempFile1ProcessTestManifest4246039871275064926.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.
/Users/<username>/repos/<repo-name>/app/<app_name>/android/app/build/intermediates/tmp/manifest/androidTest/debug/tempFile1ProcessTestManifest4246039871275064926.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 https://developer.android.com/r/studio-ui/build/manifest-merger for more information about the manifest merger.


FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugAndroidTestManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 16s
716 actionable tasks: 21 executed, 695 up-to-date


Important: 'detox build' is a convenience shortcut for calling your own build command, as provided in the config file.
Failures in this build command are not the responsibility of Detox. You are responsible for maintaining this command.

Command failed: cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug```

</details>

### Device logs

<details><summary>Device logs</summary>

N/A


</details>

### More data, please!

_No response_
@asafkorem
Copy link
Contributor

The debug build has failed, in most of the cases it has nothing to do with Detox itself.
Is that a new installation of Detox, or did you get that message after upgrading to RN 0.71? If so, we currently don't have official support for this version (check #3884 for updates).

@dakshlohar1
Copy link

I am having the same issue, anyone has any solution?

@abajajct
Copy link
Author

@asafkorem Yes, this is with 0.71.8 React-native. However on downgrading to Detox v19, I was getting a different error for react-native-mmkv-storage which I was able to resolve by putting a local patch on the package

@elioteloi
Copy link

@abajajct can you share the patch that you used to solve this issue ?

@abajajct
Copy link
Author

@elioteloi I am RN 0.71.7 and Detox 19.2

The error I see is
Task :react-native-mmkv-storage:mergeDebugAndroidTestNativeLibs FAILED
`A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction

2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:`

Fixed it by patching the build.gradle file of react-native-mmkv-storage package's adroid.default.defaultConfig by adding the below to excludes array
**/libc++_shared.so

@d4vidi
Copy link
Collaborator

d4vidi commented May 28, 2023

Duplicate of #3867

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

No branches or pull requests

5 participants