Merged Manifest Warning after upgrading Android Studio to 3.2.1

17,893

Solution 1

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" />

Solution 2

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" />
Share:
17,893
Venu G.
Author by

Venu G.

Updated on June 19, 2022

Comments

  • Venu G.
    Venu G. about 2 years

    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:

    1. 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?

    2. What is the warning about? Do I need to add an activity in my app's AndroidManifest.xml for Firebase for some reason?

    3. 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.

  • ggDeGreat
    ggDeGreat over 5 years
    this is not a proper solution, u just disable the google indexing warning
  • Venu G.
    Venu G. over 5 years
    Not everyone needs to do the link, so it is the solution for those people. Plus, for those who want to do the linking, I provided the link in my answer above on how to do that (enter link description here - url : developer.android.com/studio/write/app-link-indexing).
  • Venu G.
    Venu G. over 5 years
    Eventually I did do the app link indexing (see link above) because I wanted that anyway for google indexing.
  • Francesco
    Francesco almost 5 years
    what do you mean about 'the application node in the manifest additions'? Thanks
  • kasun sampath adhikari
    kasun sampath adhikari almost 5 years
    <manifest ... > <application ... > <activity android:name="com.example.myapp.MainActivity" ... > </activity> </application> </manifest>
  • Kruupös
    Kruupös over 4 years
    How and where did you found this solution ?
  • SeanMC
    SeanMC over 4 years
    I've seen the first part elsewhere. Why do you need the second part? stackoverflow.com/questions/54577588/…