3

In a react-native project, ive recently updated to v66.4 from v63.2

after some dependency conflict troubleshooting, i ultimately get a merged manifest error, that indicates suggestions for 3 locations

initially this was 4 locations

i added android:exported="true" to the main projects manifest xml

now 1/4 issues resolved

3 remain, and theyre all the same issue

they indicate a problem with the manifest file for the test:core:1.3.0

ok, so i add the android:exported="true" flag to each of the activities in that manifest

i then build the debug apk, it compiles successfully, installs, and runs

but if i run ./gradlew clean and then try to build the apk again, it gives me the same error with the 3 activities from test:core:1.3.0

heres an example of the errors:

enter image description here

how can i resolve this permanently?

Jim
  • 1,988
  • 6
  • 34
  • 68

1 Answers1

0

Head over to your AndroidManifest.xml file for the main flavour. Go to the merged Manifest tab Merged Manifest

And take a look at your merged manifest there and see what is causing problem. If I'm not mistaken you can override some of other manifests properties by specifying the correct one in main manifest since they have priority over those from 3rd party libraries.

Fot your case it's probably adding android:exported="true" for the activities that have intent filters specified inside them.

  • thanks, ive done this, also tried adding various attribute flags like `tools:node="remove"` and `tools:node="merge"` and `tools:replace=` – Jim May 19 '22 at 20:06
  • the problem is it keeps re-generating because its originating from the generated manifest file of androix.test.core.1.3.0, and im not sure where thats coming from or why setting manifest merge rules in high-priority manifests isnt working – Jim May 19 '22 at 20:06
  • 1
    Got it! Unfortunately I don't know how to search where it originates from, but perhaps you can print your dependency tree and see from which library it comes from https://docs.gradle.org/current/userguide/userguide_single.html#sec:listing_dependencies. Maybe it will be easier to find a solution knowing where androids.test.core comes from. Apart from that it seems weird that it is included when building the app, it seems like it should be limited to running tests. Maybe some of your dependencies should have it as testImplementation instead. – Kuba Adamczyk May 22 '22 at 15:46