Manifest merge fails when building androidTest package due to missing placeholder substitution
See original GitHub issueDescribe the problem
We use detox/espresso to test our application. It builds a second application androidTest
which is used alongside the main application to run grey box e2e tests.
Gradle fails processing the manifest for the test application. manifestPlaceholders substitutions are required. The main application builds fine.
We’re not using the webAuth so have both the manifestPlaceholders defined and the snippet to remove the activities in AndroidManifest
We’ve gone back to 2.8.3 for now.
What was the expected behavior?
Reproduction
Using the detox react native android example: https://github.com/wix/Detox/tree/master/examples/demo-react-native
Add auth0 as a dependency to the main project as per readme
Configure the manifestPlaceholders
in app/build.gradle
As we’re not using the webAuth parts of this lib, also add the remove snippets to the AndroidManifest
<activity
android:name="com.auth0.react.AuthenticationActivity"
tools:node="remove"/>
<activity
android:name="com.auth0.react.RedirectActivity"
tools:node="remove"/>
Build the main app and the test app.
./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release
Build will fail
node_modules/react-native-auth0/android/build/intermediates/tmp/manifest/androidTest/debug/manifestMerger7170877575298229251.xml Error:
Attribute data@host at manifestMerger7170877575298229251.xml requires a placeholder substitution but no value for <auth0Domain> is provided.
node_modules/react-native-auth0/android/build/intermediates/tmp/manifest/androidTest/debug/manifestMerger7170877575298229251.xml Error:
Attribute data@scheme at manifestMerger7170877575298229251.xml requires a placeholder substitution but no value for <auth0Scheme> is provided.
Environment
- Version of this library used: 2.9.0
- Which framework are you using, if applicable: RN 0.63.3
- Other modules/plugins/libraries that might be involved: Detox 17.9.0
- Any other relevant information you think would be useful: I believe it’s possible the manifestPlaceholders are not injected into android manifests for android test applications.
Issue Analytics
- State:
- Created 2 years ago
- Comments:22 (9 by maintainers)
Top GitHub Comments
Good news! The method suggested in the OneSignal repo here worked! I added this section to
android/build.gradle
and now my Detox build is successful.I verified that those placeholder values are indeed being fed through to
android/app/build/intermediates/merged_manifest/debug/AndroidManifest.xml
. When I build the regular version of the app, I get the “real” values from thedefaultConfig
section ofandroid/app/build.gradle
. When I build the Detox version, the merged manifest contains the E2E test values. 👍 I’ve updated the example repo with this changeI don’t know Gradle well enough to say if this is the “correct” solution, but it definitely works for me. Many, many thanks for your assistance, @lbalmaceda!
Thanks for looking into this @lbalmaceda & @markpar. I’ll add this to our maintenance window next week to try this out.