[英]Adding FbFlipper in Android Project gives build error = processDebugManifest > Manifest merger failed
I have added FbFlipper Metrics. 我添加了FbFlipper指标。 I am getting this error.
我收到此错误。
Task :app:processDebugManifest FAILED /home/user/Git/my-project/app/src/main/AndroidManifest.xml:22:18-91 Error: Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
任务:app:processDebugManifest失败/home/user/Git/my-project/app/src/main/AndroidManifest.xml:22:18-91错误:属性application @ appComponentFactory value =(android.support.v4.app.CoreComponentFactory )中的[))也存在于[androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86中;来自[com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91值=(androidx.core.app.CoreComponentFactory)。 Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:21:583-76:18 to override.
建议:在AndroidManifest.xml:21:583-76:18的元素上添加'tools:replace =“ android:appComponentFactory”'以进行覆盖。
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
有关清单合并的更多信息,请参见http://g.co/androidstudio/manifest-merger 。
FAILURE: Build failed with an exception.
失败:构建失败,发生异常。 * What went wrong: Execution failed for task ':app:processDebugManifest'.
*出了什么问题:任务':app:processDebugManifest'的执行失败。 Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
清单合并失败:[com.android.support:support-compat:28.0.0]的属性application @ appComponentFactory value =(android.support.v4.app.CoreComponentFactory)来自AndroidManifest.xml:22:18-91 [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value =(androidx.core.app.CoreComponentFactory)。 Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:21:583-76:18 to override.
建议:在AndroidManifest.xml:21:583-76:18的元素上添加'tools:replace =“ android:appComponentFactory”'以进行覆盖。
For More Information: 欲获得更多信息:
I have added FbFlipper Metrics library as: In build.gradle under dependencies: 我添加了FbFlipper Metrics库作为:在build.gradle中的依赖项下:
debugImplementation 'com.facebook.flipper:flipper:0.22.0'
debugImplementation 'com.facebook.soloader:soloader:0.6.0'
And if i comment/remove the above mentioned lines from build.gradle. 如果我评论/从build.gradle中删除上述行。 Project build successfully and runs fine on device.
项目构建成功,并且可以在设备上正常运行。
But if i add these lines to add FbFlipper. 但是,如果我添加这些行以添加FbFlipper。 It gives build error.
它给出了构建错误。
Keeping in View i have no duplicate activity names in Android Manifest. 保持查看状态,Android Manifest中没有重复的活动名称。 Also i have updated compileSdkVersion from 27 to 28 which resolves my earlier issue which was:
我也将compileSdkVersion从27更新到28,解决了我之前的问题:
Execution failed for task ':app:processDebugResources'.
任务':app:processDebugResources'的执行失败。 Android resource linking failed
Android资源链接失败
Now i'll appreciate any help in this regard, Point me where i am wrong. 现在,我将感谢您在这方面的任何帮助,指出我错了。 how to make FbFlipper metrics working in android project.
如何使FbFlipper指标在android项目中工作。 Thanks in advance
提前致谢
My Environment details: 我的环境详细信息:
I resolve this error by Migrating all support libraries to AndroidX . 我通过将所有支持库迁移到AndroidX来解决此错误。
You can do it as: 您可以按照以下方式进行操作:
In gradle.build (app) add sdkVersion as 28: 在gradle.build(app)中将sdkVersion添加为28:
compileSdkVersion 28
defaultConfig {
......
targetSdkVersion 28
......
}
Also add these implementations to migrate to androidx :- 还添加这些实现以迁移到androidx:-
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
Then add these below two lines to gradle.properties:- 然后将以下两行添加到gradle.properties:-
android.useAndroidX=true
android.enableJetifier=true
You can also do that from android studio in automated format. 您也可以从android studio以自动格式进行操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.