简体   繁体   English

如何修复“清单合并失败并出现多个错误”错误?

[英]How to fix ' Manifest merger failed with multiple errors,' error?

I was connecting FIREBASE to my current working AndroidStudio project and after implementing all the libraries, I am stuck at an error.我正在将 FIREBASE 连接到我当前工作的 AndroidStudio 项目,在实现所有库后,我遇到了错误。

"ERROR: Manifest merger failed with multiple errors, see logs" “错误:清单合并因多个错误而失败,请参阅日志”

What should i do..?我该怎么办..?

This is error , what i am getting这是错误,我得到了什么

Dependencies using groupId com.android.support and androidx.* can not be combined but found IdeMavenCoordinates{myGroupId='com.android.support', myArtifactId='cardview-v7', myVersion='28.0.0', myPacking='aar', myClassifier='null'} and IdeMavenCoordinates{myGroupId='androidx.swiperefreshlayout', myArtifactId='swiperefreshlayout', myVersion='1.0.0', myPacking='aar', myClassifier='null'} incompatible dependencies less... (Ctrl+F1) Inspection info:There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs.使用 groupId com.android.support 和 androidx.* 的依赖不能合并,但是发现 IdeMavenCoordinates{myGroupId='com.android.support', myArtifactId='cardview-v7', myVersion='28.0.0', myPacking='aar ', myClassifier='null'} 和 IdeMavenCoordinates{myGroupId='androidx.swiperefreshlayout', myArtifactId='swiperefreshlayout', myVersion='1.0.0', myPacking='aar', myClassifier='null'} 不兼容的依赖项较少.. . (Ctrl+F1) 检查信息:有些库或工具和库的组合不兼容,或可能导致错误。 One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion).一种此类不兼容性是使用非最新版本的 Android 支持库版本(或者特别是低于您的 targetSdkVersion 的版本)进行编译。 Issue id: GradleCompatible enter ima[enter image description here] 1 ge description here问题 id: GradleCompatible enter ima[enter image description here] 1 ge description here

This problem should occur from using both androidx and android support libraries at the same time.同时使用 androidx 和 android 支持库应该会出现此问题。 Migrate the whole project to AndroidX by using Refactor > Migrate to AndroidX from the IDE.迁移整个项目AndroidX通过使用Refactor > Migrate to AndroidX从IDE。 After migrating to AndroidX, recheck if you have these two lines in your gradle.properties file:迁移到 AndroidX 后,重新检查gradle.properties文件中是否有这两行:

android.useAndroidX=true
android.enableJetifier=true

Setting these two gradle plugin flags to true means that Android Plugin will use appropriate AndroidX library instead of support Library & will rewrite their binaries.将这两个 gradle 插件标志设置为 true 意味着 Android 插件将使用适当的 AndroidX 库而不是支持库并重写它们的二进制文件。 For knowing more how to migrate an entire project to AndroidX, please follow this link .要了解更多如何将整个项目迁移到 AndroidX,请点击此链接

  1. Right click on the 'build.gradle (Module:app)'右键单击“build.gradle (Module:app)”
  2. Select Refactor > Migrate to AndroidX选择重构 > 迁移到 AndroidX
  3. After processing, click 'Do Refactor'.处理后,单击“进行重构”。 This button will be in below left corner of IDE (Look carefully).这个按钮会在IDE的左下角(仔细看)。

  4. Update library versions to latest versions in build.gradle (Module:App).在 build.gradle (Module:App) 中将库版本更新为最新版本。 Alt+Enter will help you out. Alt+Enter 会帮助你。

  5. Sync Gradle and I hope this will solve the problem as it solved mine.同步 Gradle,我希望这能解决我的问题。

I am also a newbie in android app development.我也是android应用程序开发的新手。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM