20

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.

Adinia
  • 3,722
  • 5
  • 40
  • 58
Venu G.
  • 427
  • 1
  • 5
  • 10
  • 1
    Did you find any Solution – Vinit Poojary Oct 29 '18 at 09:40
  • 2
    No. Are you experiencing this as well? – Venu G. Oct 29 '18 at 17:04
  • 1
    yup getting same warning – Vinit Poojary Oct 30 '18 at 05:00
  • 2
    I have submitted a bug report to Firebase (which is where I suspect the problem lies, but it very well may be AS 3.2.1). If I get a reply with anything useful, I will update this. – Venu G. Oct 30 '18 at 22:04
  • I got a response from Firebase support but they could not reproduce it. They would like to get an MCVE (https://stackoverflow.com/help/mcve) as can be expected, but right now I do not have the time to create one. @Vinit, if you are able to do this, feel free to send them one. The case number is [5-4824000024047] for your reference. – Venu G. Oct 31 '18 at 14:43
  • I have the same issue. I wonder would having another Manifest at debug source set be a requirement for reproducing of the issue? – Alexander Skvortsov Nov 14 '18 at 13:57

7 Answers7

14

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

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
1

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.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
1

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" />
Tony Jara
  • 69
  • 2
0

I had the same issue. It was not due to Firebase.

I had created a new launcher icon that I called my_launcher. The 2 generated files my_launcher.xml and my_launcher_round.xml had errors.

For my case, it didn't find @mipmap/ic_launcher_background for the background tag. I removed it and the rebuild worked.

Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142
user2184075
  • 34
  • 1
  • 3
0

I reproduce issue came if you have package with Uppercase, please re-check your naming package. to solve this issue make all package name you created to lowercase.

before

after

0

open command prompt and then type below command

cd android && gradlew clean
donkey
  • 478
  • 7
  • 10
-5

Figured out what was causing this !

The whole <application>...</application> section was being highlighted because of the warning

enter image description here

I was able to fix the issue by adding the line

<application

      ..

      tools:ignore="GoogleAppIndexingWarning"

      ..>
      ..

</application>

Alternately, one may want to add a link from a URL - for more info, see enter link description here

https://stackoverflow.com/users/8278273/vinit-poojary, hope this helps you.

Venu G.
  • 427
  • 1
  • 5
  • 10
  • this is not a proper solution, u just disable the google indexing warning – ggDeGreat Nov 09 '18 at 07:32
  • 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 : https://developer.android.com/studio/write/app-link-indexing). – Venu G. Nov 09 '18 at 15:37
  • Eventually I did do the app link indexing (see link above) because I wanted that anyway for google indexing. – Venu G. Nov 14 '18 at 17:32