[英]Manifest merger Failed after adding Google Firebase Authentication
After adding Firebase Authentication to app implementation I got a Manifest Merger failed error. 将Firebase身份验证添加到应用程序实施后,出现了清单合并失败错误。
"Manifest merger failed with multiple errors, see logs" “清单合并失败,出现多个错误,请参阅日志”
I tried using different versions of the authentication but didn't work. 我尝试使用不同版本的身份验证,但是没有用。 The solutions for the same type of problems in StackOverflow didn't work for me. StackOverflow中针对相同类型问题的解决方案对我不起作用。
I tried the suggested changes in Merged manifest but this error came up again 我尝试了合并清单中的建议更改,但此错误再次出现
Merging Errors: Error: tools:replace specified at line:6 for attribute android:appComponentFactory, but no new value specified app main manifest (this file), line 5 Error: Validation failed, exiting app main manifest (this file) 合并错误:错误:为属性android:appComponentFactory在第6行指定了tools:replace,但未指定新值app主清单(此文件),第5行错误:验证失败,退出了app主清单(此文件)
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:appComponentFactory">
<activity android:name=".VerifyEmployeeID"></activity>
<activity android:name=".SignUp" />
<activity android:name=".login" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.0.5'
//firebase database
implementation 'com.google.firebase:firebase-database:16.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
I need to get rid of this error. 我需要摆脱这个错误。
This happens because you are using simple dependency or androidx support dependency. 发生这种情况是因为您使用的是简单依赖项或androidx支持依赖项。 That's why this error occurs. 这就是发生此错误的原因。
Remove below the line in Manifest.xml 删除Manifest.xml中的行下方
tools:replace="android:appComponentFactory" tools:replace =“ android:appComponentFactory”
Use this dependency in build.gradle 在build.gradle中使用此依赖项
implementation 'com.google.firebase:firebase-core:16.0.9' 实施'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-auth:17.0.0' 实施'com.google.firebase:firebase-auth:17.0.0'
Remove all androidx dependency in your build.gradle file and sync project. 删除build.gradle文件中的所有androidx依赖项并同步项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.