简体   繁体   English

清单合并失败,Android Studio 中出现多个错误

[英]Manifest Merger failed with multiple errors in Android Studio

So, I am a beginner into Android and Java.所以,我是 Android 和 Java 的初学者。 I just began learning.我刚开始学习。 While I was experimenting with Intent today, I incurred an error.今天我在尝试Intent时,遇到了一个错误。

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs

I found some solutions here and tried to implement them, but it did not work.我在这里找到了一些解决方案并尝试实施它们,但没有奏效。

This is my build.gradle :这是我的 build.gradle :

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.0"

defaultConfig {
    applicationId "com.example.rohan.petadoptionthing"
    minSdkVersion 10
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
}

This is my AndroidManifest :这是我的 AndroidManifest :

<?xml version="1.0" encoding="utf-8"?>

package="com.example.rohan.petadoptionthing" >

<application

    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name=".Second"
        />

    <activity android:name=".third"/>
    <activity android:name=".MainActivity"/>


</application>

This is my first week with coding, I am sorry if this is a really silly thing.这是我编码的第一周,如果这是一件非常愚蠢的事情,我很抱歉。 I am really new to this and did not find any other place to ask.我对此真的很陌生,没有找到任何其他地方可以问。 Sorry if I broke any rules对不起,如果我违反了任何规则

Open application manifest ( AndroidManifest.xml ) and click on Merged Manifest tab on bottom of your edit pane.打开应用程序清单 ( AndroidManifest.xml ) 并单击编辑窗格底部的Merged Manifest选项卡。 Check the image below:检查下图:

在此处输入图像描述

From image you can see Error in the right column, try to solve the error.从图像中您可以在右栏中看到错误,尝试解决错误。 It may help some one with the same problem.它可能会帮助有同样问题的人。 Read more here . 在这里阅读更多。

Also, once you found the error and if you get that error from external library that you are using, You have to let compiler to ignore the attribute from the external library.此外,一旦发现错误并且从正在使用的外部库中获取该错误,您必须让编译器忽略来自外部库的属性。 //add this attribute in application tag in the manifest //在manifest的application标签中添加这个属性

   tools:replace="android:allowBackup" 
                                                                                                                                          
   //Add this in the manifest tag at the top

   xmlns:tools="http://schemas.android.com/tools"

Remove <activity android:name=".MainActivity"/> from your mainfest file.从您的 mainfest 文件中删除<activity android:name=".MainActivity"/> As you have already defined it as:正如您已经将其定义为:

 <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

So, Manifest file showing ambiguity.因此,清单文件显示歧义。

I was also facing same issues, and after lot of research found the solution:我也面临同样的问题,经过大量研究找到了解决方案:

  1. Your min sdk version should be same as of the modules you are using eg: your module min sdk version is 14 and your app min sdk version is 9 It should be same.您的 min sdk 版本应与您正在使用的模块相同,例如:您的模块 min sdk 版本为 14,您的应用程序 min sdk 版本为 9 它应该相同。
  2. If build version of your app and modules not same.如果您的应用程序和模块的构建版本不同。 Again it should same ** In short, your app build.gradle file and manifest should have same configurations**同样应该相同**简而言之,您的应用程序build.gradle文件和清单应该具有相同的配置**
  3. There's no duplicacy like same permissions added in manifest file twice, same activity mention twice.没有重复,例如在清单文件中添加两次相同的权限,两次提及相同的活动。
  4. If you have delete any activity from your project, delete it from your manifest file as well.如果您从项目中删除了任何活动,请将其从清单文件中删除。
  5. Sometimes its because of label, icon etc tag of manifest file:有时是因为清单文件的标签、图标等标签:

a) Add the xmlns:tools line in the manifest tag. a) 在清单标签中添加xmlns:tools行。

b) Add tools:replace= or tools:ignore= in the application tag. b) 在应用标签中添加tools:replace=tools:ignore=

Example:例子:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.slinfy.ikharelimiteduk"
    xmlns:tools="http://schemas.android.com/tools"
    android:versionCode="1"
    android:versionName="1.0" >

  <application
      tools:replace="icon, label"
      android:label="myApp"
      android:name="com.example.MyApplication"
      android:allowBackup="true"
      android:hardwareAccelerated="false"
      android:icon="@drawable/ic_launcher"
      android:theme="@style/Theme.AppCompat" >
  </application>

</manifest>
  1. If two dependencies are of not same version example: you are using dependency for appcompat v7:26.0.0 and for facebook com.facebook.android:facebook-android-sdk:[4,5) facebook uses cardview of version com.android.support:cardview-v7:25.3.1 and appcompat v7:26.0.0 uses cardview of version v7:26.0.0, So there is discripancy in two libraries and thus give error如果两个依赖项的版本不同,例如:您正在使用 appcompat v7:26.0.0 和 facebook com.facebook.android:facebook-android-sdk:[4,5) 的依赖项,facebook 使用版本 com.android 的 cardview。 support:cardview-v7:25.3.1 和 appcompat v7:26.0.0 使用了 v7:26.0.0 版本的 cardview,所以两个库存在差异,因此报错

Error:Execution failed for task ':app:processDebugManifest'.错误:任务“:app:processDebugManifest”执行失败。

Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.0-alpha1) from [com.android.support:appcompat-v7:26.0.0-alpha1] AndroidManifest.xml:27:9-38 is also present at [com.android.support:cardview-v7:25.3.1] AndroidManifest.xml:24:9-31 value=(25.3.1).清单合并失败:来自 [com.android.support:appcompat-v7:26.0.0-alpha1] AndroidManifest.xml:27:9 的属性 meta-data#android.support.VERSION@value value=(26.0.0-alpha1) -38 也存在于 [com.android.support:cardview-v7:25.3.1] AndroidManifest.xml:24:9-31 value=(25.3.1)。 Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:25:5-27:41 to override.建议:将 'tools:replace="android:value"' 添加到 AndroidManifest.xml:25:5-27:41 的元素以覆盖。

So by using appcompat of version 25.3.1, We can avoid this error所以通过使用 25.3.1 版本的 appcompat,我们可以避免这个错误

By considering above points in mind, you will get rid of this irritating issue.通过考虑以上几点,您将摆脱这个恼人的问题。 You can check my blog too https://wordpress.com/post/dhingrakimmi.wordpress.com/23你也可以查看我的博客https://wordpress.com/post/dhingrakimmi.wordpress.com/23

For me THIS works -对我来说,这有效 -

Finding Merging Errors in AndroidManifest.xmlAndroidManifest.xml中查找合并错误

在此处输入图像描述

Click on Merged Manifest in AndroidManifest.xml点击AndroidManifest.xml中的 Merged Manifest

在此处输入图像描述

You can view manifest merging error in right column.您可以在右栏中查看清单合并错误。 It may help to solve this problem.它可能有助于解决这个问题。

In addition to available solutions, please check this also.除了可用的解决方案,请检查此。
If you have set android:allowBackup="false" in your AndroidManifest.xml then there may be a conflict for android:allowBackup="true" in other dependencies.如果你在你的AndroidManifest.xml中设置了android:allowBackup="false"那么其他依赖项中的android:allowBackup="true"可能会发生冲突。

Solution解决方案
As suggested by @CLIFFORD PY, switch to Merged Manifest in your AndroidManifest.xml .正如@CLIFFORD PY 所建议的,在您的AndroidManifest.xml中切换到Merged Manifest Android Studio will suggest to add tools:replace="android:allowBackup" in <application /> in your AndroidManifest.xml . Android Studio 会建议在AndroidManifest.xml<application />中添加tools:replace="android:allowBackup"

I was facing the same problem and I've just added one line in my manifest.xml and it worked for me.我遇到了同样的问题,我刚刚在 manifest.xml 中添加了一行,它对我有用。

tools:replace="android:allowBackup,icon,theme,label,name"> 

add this line under在下面添加这一行

<application
    android:name=".MyApplication"
    android:allowBackup="true"
    android:icon="@drawable/launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:screenOrientation="portrait"
    android:supportsRtl="true"
    android:theme="@style/AppThemecustom"
    tools:replace="android:allowBackup,icon,theme,label">

Hope it will help.希望它会有所帮助。

Just add below code in your project Manifest application tag...只需在您的项目清单应用程序标记中添加以下代码...

<application
        tools:node="replace">

如果您的项目针对 Android 12,则将其添加到所有带有<intent-filter> <activity>标记中

android:exported="true/false"

I solved this with Refactor -> Migrate to AndroidX我用Refactor -> Migrate to AndroidX解决了这个问题

GL总帐

In my case it was showing an error because there was a redundancy in <uses-permission> element.在我的情况下,它显示错误,因为<uses-permission>元素中存在冗余。 So, please check in your AndroidManifest.xml file for the same.因此,请检查您的AndroidManifest.xml文件是否相同。

Android Studio version is 3.0.1 Android Studio 版本为 3.0.1

Operating System is Windows 7操作系统是 Windows 7

Here is the screenshot for reference.这是供参考的屏幕截图。

显示清单文件中冗余的屏幕截图。

通常在清单中有错误时发生。打开 AndroidManifest.xml。单击合并的清单选项卡。可以在那里看到错误。还包括那里提到的建议。当我在导入 com.google.android.gms 时遇到类似问题时.maps.model.LatLng ,它建议我在应用程序标签中包含 tools:overrideLibrary="com.google.android.gms.maps" 并且构建成功。

My case i have fixed it by我的情况我已经解决了

build.gradle(Module:app) build.gradle(模块:应用程序)

defaultConfig {
----------
multiDexEnabled true
}
dependencies {
    ...........
    implementation 'com.google.android.gms:play-services-gcm:11.0.2'
    implementation 'com.onesignal:OneSignal:3.+@aar'
    }

This answer releted to OnSignal push notification此答案与 OnSignal 推送通知有关

I was also facing this error.我也面临这个错误。 In the build log the last line was "Failed to compile values file".在构建日志中,最后一行是“无法编译值文件”。

So if you're facing the same issue, then just adding the following line in the gradle.properties file will most probably fix the issue.因此,如果您遇到同样的问题,那么只需在 gradle.properties 文件中添加以下行很可能会解决问题。

android.enableJetifier=true

I mean it fixed Manifest Merger failed with multiple errors in Android Studio error for me.我的意思是它为我修复Manifest Merger failed with multiple errors in Android Studio错误。

solution for me was like this:我的解决方案是这样的:

1- open manifest 1-打开清单

2-On top right , check highlighted problems like below: 2-在右上角,检查突出显示的问题,如下所示:

3-click on problems icon in red. 3 单击红色的问题图标。 this will open problems tab like below.这将打开问题选项卡,如下所示。 问题选项卡

4- solve them one by one 4-一一解决

  1. In AndroidManifest.xml :AndroidManifest.xml中:

    • At application, add tools:replace="android:icon, android:theme and在应用程序中,添加tools:replace="android:icon, android:theme
    • At the Manifest root, add xmlns:tools="http://schemas.android.com/tools在 Manifest 根目录下,添加xmlns:tools="http://schemas.android.com/tools
  2. In build.gradle :build.gradle

    • At root, add useOldManifestMerger true在根目录下,添加useOldManifestMerger true

If after you add a Android Library Module and you get this error.如果在添加Android 库模块后出现此错误。
You can fix it by simple remove the android:label="@string/app_name" from the AndroidManifest.xml of your Android Library Module您可以通过简单地从Android 库模块AndroidManifest.xml中删除android:label="@string/app_name"来修复它

minium sdk 版本应与您正在使用的 modules/lib 相同 例如:您的模块 min sdk 版本为 26,您的 app min sdk 版本为 21 应该相同。

I see the answers and they are complete and useful.我看到了答案,它们是完整且有用的。 Anyway, if you are completing the Jetpack Compose Testing codelab and you find this error in late 2021, the solution is not the accepted answer, you need to downgrade your target sdk version to 30.无论如何,如果您正在完成Jetpack Compose 测试 codelab并且您在 2021 年末发现此错误,则解决方案不是公认的答案,您需要将目标 sdk 版本降级到 30。

In app/build.gradle, replace:在 app/build.gradle 中,替换:

targetSdkVersion 31

with:和:

targetSdkVersion 30

And run the Android Tests again并再次运行 Android 测试

for the past few days I was also going through the same issue.在过去的几天里,我也遇到了同样的问题。 But after, a lot of research I finally found a solution for this.但经过大量研究后,我终于找到了解决方案。
In order to solve this issue, what you need to do is:为了解决这个问题,你需要做的是:
1. Check if your project's build.gradle file and the module's build.gradle file contain same versions of all dependencies. 1.检查你的项目的build.gradle文件和模块的build.gradle文件是否包含所有依赖的相同版本。
2. Make sure, your project's compileSdkVersion , buildToolsVersion , minSdkVersion and targetSdkVersion matches the one in the modules or libraries that you have added into the project. 2. 确保您的项目的compileSdkVersionbuildToolsVersionminSdkVersiontargetSdkVersion与您添加到项目中的模块中的相匹配。

compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
    applicationId "com.example.appname"
    minSdkVersion 16
    targetSdkVersion 25
    versionCode 22
    versionName "2.0.3"

}

Hope, this helps.希望这可以帮助。

I was using the FirebaseUI Library along with the Facebook SDK Library , which was causing me the issue.我正在使用FirebaseUI LibraryFacebook SDK Library ,这导致了我的问题。

implementation 'com.firebaseui:firebase-ui-database:0.4.4'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'

And from [here][1], I got rid of this issue.从[这里] [1],我摆脱了这个问题。

With the latest update of FirebaseUI library , previous version of Facebook SDK is also a part of it.随着FirebaseUI 库latest update ,之前版本的 Facebook SDK 也是其中的一部分。

If you are using the both the libraries, please remove the Facebook SDK Library .如果您同时使用这两个库,请删除 Facebook SDK 库

https://github.com/firebase/FirebaseUI-Android/issues/230 https://github.com/firebase/FirebaseUI-Android/issues/230

UPDATE更新

From the Android Studio 3.0 and the later versions, app.gradle file is required to use implementation or api instead of compile for adding the dependencies to the app.Android Studio 3.0及以后的版本开始,需要app.gradle文件才能使用implementationapi而不是compile来为应用添加依赖项。

Open your gradle console, then you see gradle suggest you to add the particular line (Like: tools:replace="android:allowBackup" or tools:replace="android:label" etc).打开您的 gradle 控制台,然后您会看到 gradle 建议您添加特定的行(例如:tools:replace="android:allowBackup" 或 tools:replace="android:label" 等)。 Add that line into your manifest file under tag and sync gradle, that's it.将该行添加到您的清单文件中的标记和同步 gradle 下,就是这样。

In my case it happened for leaving some empty intent-filter inside the Activity tag在我的情况下,它发生在Activity标签内留下一些空的意图过滤器

    <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">

            <intent-filter>

            </intent-filter>

    </activity> 

So just removing them solved the problem.因此,只需删除它们即可解决问题。

    <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
    </activity> 

The following hack works:以下黑客作品:

  1. Add the xmlns:tools="http://schemas.android.com/tools" line in the manifest tag在清单标签中添加xmlns:tools="http://schemas.android.com/tools"
  2. Add tools:replace="android:icon,android:theme,android:allowBackup,label,name" in the application tag在应用标签中添加tools:replace="android:icon,android:theme,android:allowBackup,label,name"

This error occurs because you don't have proper statements at the Manifest root such:发生此错误是因为您在 Manifest 根目录中没有正确的语句,例如:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.test">

So you should remove additional texts in it.因此,您应该删除其中的其他文本。

In my case, I solved it by updating the classpath in build.gradle (Project) file to the latest version.就我而言,我通过将 build.gradle (Project) 文件中的类路径更新到最新版本来解决它。

It was like this:是这样的:

dependencies {
    classpath 'com.android.tools.build:gradle:3.5.0'
}

After updating to the latest version:更新到最新版本后:

dependencies {
    classpath 'com.android.tools.build:gradle:3.5.4'
}

Everything worked fine!一切正常! Hope this helps someone if all the above answers don't solve the issue.如果以上所有答案都不能解决问题,希望这对某人有所帮助。

As a newbie to Android Studio, in my case, I had moved an existing project from Eclipse to Android Studio and found that there was a duplicate definition of an activity within my Manifest.xml that hadn't been picked up by Eclipse was shown as a Gradle error.作为 Android Studio 的新手,在我的例子中,我将一个现有项目从 Eclipse 移动到 Android Studio,发现我的 Manifest.xml 中有一个重复的活动定义,该定义没有被 Eclipse 选中,显示为Gradle 错误。

I found this by going to the Gradle Console (bottom right of the screen).我通过转到 Gradle 控制台(屏幕右下角)找到了这个。

Happened with me twice when I refractor (Rename with SHIFT + F6) the name of a field in our files and it asks you to change it everywhere and we without paying attention change the name everywhere.当我折射(使用 SHIFT + F6 重命名)我们文件中的字段名称时发生了两次,它要求您在任何地方更改它,而我们却不注意到处更改名称。 For example, if you have a variable name "id" in your Java class and you rename it with SHIFT + F6.例如,如果您的 Java 类中有一个变量名称“id”,并且您使用 SHIFT + F6 重命名它。 If you don't pay attention to the next dialog which will ask you wherever else it is going to change the id and you tick check all it will change all the id in your layout files from the new value.如果您不注意下一个对话框,它会询问您将在哪里更改 id,并且您勾选检查所有它将更改布局文件中的所有 id 的新值。

this is very simple error only occur when you define any activity call two time in mainifest.xml file Example like这是一个非常简单的错误,仅当您在 mainifest.xml 文件中定义任何活动调用两次时才会发生示例,例如

<activity android:name="com.futuretech.mpboardexam.Game" ></activity>

//and launcher also------like that



//solution:use only one 

Put this at the end of your app module build.gradle:把它放在你的应用程序模块 build.gradle 的末尾:

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
    def requested = details.requested
    if (requested.group == 'com.android.support') {
        if (!requested.name.startsWith("multidex")) {
            details.useVersion '25.3.0'
        }
    }
}}

from this由此

Supplement the answer Phan Van Linh.补充答案 Phan Van Linh。 I deleted these lines:我删除了这些行:

  android:icon="@mipmap/ic_launcher"
  android:label="name"

我通过从 AndroidManifest.xml 中删除以下行来解决这个问题

android:allowBackup="true"

只需如上所示迁移到 Androidx,然后将最低 sdk 版本设置为 26 ......毫无疑问,这可以完美运行

In my case i was using some annotations from jetbrains library.就我而言,我使用的是 jetbrains 库中的一些注释。 I removed those annotations and dependencies and it worked fine.我删除了这些注释和依赖项,它工作正常。

So please check the libraries in android code and dependencies carefully.所以请仔细检查android代码和依赖项中的库。

If you're using multiple manifestPlaceholder items in your build.gradle file, you must add them as array elements, instead of separate items.如果您在build.gradle文件中使用多个manifestPlaceholder项,则必须将它们添加为数组元素,而不是单独的项。

For example, this will cause a build error or compile error: "java.lang.RuntimeException: Manifest merger failed with multiple errors":例如,这将导致构建错误或编译错误:“java.lang.RuntimeException: Manifest merge failed with multiple errors”:

android {
    ...
    defaultConfig {
        manifestPlaceholders = [myKey1: "myValue1"]
        manifestPlaceholders = [myKey2: "myValue2"] // Error!
    }
}

This will fix the error:这将修复错误:

android {
    ...
    defaultConfig {
        manifestPlaceholders = [myKey1: "myValue1", myKey2: "myValue2"]
    }
}

This is because you are using the new Material library with the legacy Support Library.这是因为您将新材料库与旧支持库一起使用。

You have to migrate android.support to androidx in order to use com.google.android.material .您必须将android.support迁移到androidx才能使用com.google.android.material

If you are using android studio v 3.2 or above, simply如果您使用的是 android studio v 3.2 或更高版本,只需

go to refactor ---> MIGRATE TO ANDROID X.去重构 ---> 迁移到 ANDROID X。

Do make a backup of your project.请备份您的项目。

After seeing CLIFFORD's answer to see the error, what helped me to solve this issue was renaming 'android:namex' to 'android:name' in the intent-filter action tag.在看到 CLIFFORD 看到错误的答案后,帮助我解决此问题的是将意图过滤器操作标记中的 'android:namex' 重命名为 'android:name' 。 In case if the same solution helps someone else .如果相同的解决方案对其他人有帮助。

    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:namex="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

I had a weird encounter with this problem.我遇到了这个问题很奇怪。 when renaming variable name to user_name , I mistakenly rename all of the name to user_name for the project.将变量name重命名为user_name时,我错误地将项目的所有名称重命名为user_name So my xml tag <color name:""> became <color user_name:""> same goes for string, style, manifest too.所以我的 xml 标签<color name:"">变成了<color user_name:"">字符串、样式、清单也是如此。 But when I check merged manifest, it showed nothing, because I had only one manifest, nothing to find.但是当我检查合并的清单时,它什么也没显示,因为我只有一个清单,什么都找不到。

So, check if you have any malformed xml file or not.因此,请检查您是否有任何格式错误的 xml 文件。

In my case my application tag includes:就我而言,我的应用程序标签包括:

 <application
    android:name=".common.MyApplication"
    android:allowBackup="false"
    android:extractNativeLibs="false"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:usesCleartextTraffic="true"
    tools:ignore="GoogleAppIndexingWarning"
    tools:replace="android:appComponentFactory">

I resolved this issue my adding new param as android:appComponentFactory=""我解决了这个问题,我将新参数添加为 android:appComponentFactory=""

So my final application tag becomes:所以我的最终应用程序标签变为:

<application
    android:name=".common.MyApplication"
    android:allowBackup="false"
    android:extractNativeLibs="false"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:usesCleartextTraffic="true"
    tools:ignore="GoogleAppIndexingWarning"
    tools:replace="android:appComponentFactory"
    android:appComponentFactory="">

I encountered above issue when I tired using firebase-auth latest version as "19.3.1".当我厌倦了使用 firebase-auth 最新版本为“19.3.1”时,我遇到了上述问题。 Whereas in my project I was already using firebase but version was "16.0.6".而在我的项目中,我已经在使用 firebase,但版本是“16.0.6”。

check if you've any duplicate activity declared in the manifest.检查清单中是否声明了任何重复的活动。 That was my mistake for this error and problem solved, after deleting the duplicate.这是我的错误,删除重复项后问题解决了。

For all of you that have the same problem but when you merge the manifest and there's no error at all this solution worked for me without edit your "Manifest" file and changed any configuration, delete this, delete that ect.对于所有有同样问题的人,但是当您合并清单并且完全没有错误时,此解决方案对我有用,无需编辑您的“清单”文件并更改任何配置,删除它,删除那个等。

  1. Open your "settings.gradle" file.打开您的“settings.gradle”文件。
  2. Add this code " gradlePluginPortal() ".添加此代码“ gradlePluginPortal() ”。
  • If your start a new project the code automatically might be there if you are using the updated Android Studio but you need to add once more, like code below:如果您开始一个新项目,如果您使用的是更新的 Android Studio,则代码可能会自动出现,但您需要再次添加,如下面的代码:

     pluginManagement { repositories { gradlePluginPortal() google() mavenCentral() jcenter() maven {url 'https://jitpack.io'} }

and put the code " gridlePluginCentral() " once more.并再次输入代码“ gridlePluginCentral() ”。

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        jcenter()
        maven {url 'https://jitpack.io'}
        gradlePluginPortal()
    }
}

In my case problems like this happened usually when we use the github user libraries and used it for layout files or as "imports" in java files.在我的情况下,这样的问题通常发生在我们使用 github 用户库并将其用于布局文件或作为 java 文件中的“导入”时。 It's always a good idea to keep your Android Studio up-to-date and leave the old version as there are usually changes to configuration, libraries and other supporting files.让您的 Android Studio 保持最新并保留旧版本始终是一个好主意,因为配置、库和其他支持文件通常会发生更改。 And it's best to avoid using libraries from github users, preferably using libraries from Google.并且最好避免使用来自 github 用户的库,最好使用来自 Google 的库。

in my case I was using multi models on firebase vision Dependencies in manifest file's meta-data tag, so I mixed them in one value parameter and it did solve my problem.here is how :在我的情况下,我在清单文件的元数据标签中的 firebase vision Dependencies 上使用了多个模型,所以我将它们混合在一个值参数中,它确实解决了我的问题。这里是如何:

<meta-data
    android:name="com.google.mlkit.vision.DEPENDENCIES"
    android:value="ocr,langid"/>

Simple Answer Cross Check :简单答案交叉检查:

You might be defined Same Activity multiple times in the manifest.xml file.您可能会在 manifest.xml 文件中多次定义 Same Activity。

OR或者

Activity or service or receiver you have defined in the manifest.xml file which is not in your project structure.您在 manifest.xml 文件中定义的活动或服务或接收者不在您的项目结构中。

我通过删除android:replace标签解决了这个问题

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

相关问题 清单合并失败:Android studio 多个错误 - Manifest merger failed : Android studio multiple errors 清单合并失败,出现多个错误,请参阅日志-Android Studio构建 - Manifest merger failed with multiple errors, see logs - Android Studio Build 清单合并失败并出现多个错误,请参阅日志 android studio - Manifest merger failed with multiple errors, see logs android studio 清单合并失败并出现多个错误,请参阅 Android Studio 上的日志 - Manifest merger failed with multiple errors, see logs on Android Studio Android Studio:清单合并失败,材料有多个错误:1.0.0 - Android Studio : Manifest merger failed with multiple errors with material:1.0.0 Android Studio清单合并失败,出现多个错误 - Android Studio Manifest Merger failed with multiple error 清单合并失败,出现多个错误 - Manifest merger failed with multiple errors 清单合并失败,并出现多个错误 - Manifest merger failed with multiple errors 任务&#39;:app:processDebugManifest&#39;的Android Studio:Error:Execution失败。 &gt;清单合并失败,并出现多个错误,请参阅日志 - Android Studio :Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with multiple errors, see logs Android工作室中的清单合并失败 - Manifest merger failed in android studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM