After upgrading to Android Studio 3.2.1
, when editing the AndroidManifest.xml
file, I see my <application>
section of the file highlighted in yellow (presumably due to warning below).
I also see a new tab titled Merged Manifest
which contains the warning :
Merging Errors: Warning activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launch Mode was tagged at AndroidManifest.xml:24 to replace other declarations but no other declaration present app main manifest (this file), line 23
Questions:
Is this new tab something new in AS 3.2.1? Or is it showing up since AS 3.2.1 is finding a new warning that the previous version did not?
What is the warning about? Do I need to add an activity in my app's AndroidManifest.xml for Firebase for some reason?
How do I fix it?
(Note: there was probably a Firebase update as well around the same time.)
Firebase is up-to-date at present.
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-crash:16.2.1'
Everything compiles and runs fine in spite of this.
First add the following activity to the application node in the manifest additions:
<activity
android:name="com.google.firebase.auth.internal.FederatedSignInActivity"
android:excludeFromRecents="true"
android:exported="true"
android:launchMode="singleInstance"
android:permission="com.google.firebase.auth.api.gms.permission.LAUNCH_FEDERATED_SIGN_IN"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
tools:replace="android:launchMode" />
Then add following to the Manifest.xml
:
<service android:name="com.google.firebase.components.ComponentDiscoveryService" />
<meta-data
android:name="com.google.firebase.components:com.google.firebase.auth.FirebaseAuthRegistrar"
android:value="com.google.firebase.components.ComponentRegistrar" />
<meta-data
android:name="com.google.firebase.components:com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar"
android:value="com.google.firebase.components.ComponentRegistrar" />
<meta-data
android:name="com.google.firebase.components:com.google.firebase.iid.Registrar"
android:value="com.google.firebase.components.ComponentRegistrar" />
I made it work putting the following line in AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" //add this line
...>
and only the following self closing activity tag.
<activity
android:name="com.google.firebase.auth.internal.FederatedSignInActivity"
android:excludeFromRecents="true"
android:exported="true"
android:launchMode="singleInstance"
android:permission="com.google.firebase.auth.api.gms.permission.LAUNCH_FEDERATED_SIGN_IN"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
tools:replace="android:launchMode" />
the issue was introduced with firebase-auth:16.0.5
...
keeping that dependency at the previous version is a possible workaround:
dependencies {
...
//noinspection GradleDependency
implementation "com.google.firebase:firebase-auth:16.0.4"
}
one possibly can ignore that warning, so far noticed no side effects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With