0

When I try to build my app which relies upon Firebase App Check and the debug provider under SDK version 31, as required by Google Play, I get a Manifest merger error_:

Warning:
    Package name 'com.google.android.play.core.client' used in: com.google.android.play:integrity:1.0.1, com.google.android.play:core:1.9.1.

AndroidManifest.xml Error:
    android:exported needs to be explicitly specified for <activity>. 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.
Adam Williams
  • 1,712
  • 3
  • 17
  • 30

1 Answers1

0

Apparently it is amateur hour over at Google, the firebase-appcheck-debug-testing dep has a dependency on androidx.test:core:1.2.0. It's not until 1.5.0 that we get android:exported set properly on the necessary manifest elements. Thus, any project reliant on firebase-appcheck-debug-testing will not build under targetSdkVersion 31.

+--- com.google.firebase:firebase-appcheck-debug-testing -> 16.1.0
|    +--- androidx.test:core:1.2.0

You can see this if you download the POM directly from the Maven repo:

<dependency>
    <groupId>androidx.test</groupId>
    <artifactId>core</artifactId>
    <version>1.2.0</version>
    <scope>compile</scope>
    <type>aar</type>
</dependency>

It is unclear to me why firebase-appcheck-debug-testing has not had an update to correct this. I guess they do suggest never using the DebugAppCheckProviderFactory in production, and this is one way to achieve that (whilst also preventing building the app locally)!

To work around the problem, manually force version 1.5.0 in your build.gradle:

implementation 'androidx.test:core:1.5.0'
Adam Williams
  • 1,712
  • 3
  • 17
  • 30