Android Studio에서 매니페스트 합병이 여러 오류로 실패
그래서 저는 Android와 Java의 초보자입니다. 방금 배우기 시작했습니다. 오늘 Intent를 실험하는 동안 오류가 발생했습니다.
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
여기에서 몇 가지 솔루션을 찾아서 구현하려고 시도했지만 작동하지 않았습니다.
이것은 내 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'
}
이것은 내 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>
이것은 코딩의 첫 주입니다. 이것이 정말 바보 같은 일이라면 미안합니다. 나는 정말로 이것에 익숙하지 않으며 물어볼 다른 곳을 찾지 못했습니다. 내가 규칙을 어겼다면 미안
<activity android:name=".MainActivity"/>
mainfest 파일에서 제거하십시오 . 이미 정의한대로 :
<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>
따라서 매니페스트 파일은 모호성을 보여줍니다.
오픈 응용 프로그램 매니페스트 ( AndroidManifest.xml
)를 클릭 Merged Manifest
.Check 이미지
이미지 에서 오른쪽 열의 오류 를 볼 수 있으며 오류 를 해결하십시오. 그것은 같은 문제가있는 사람을 도울 수 있습니다.
나는 또한 같은 문제에 직면하고 있었고 많은 연구 끝에 해결책을 찾았습니다.
- min sdk 버전은 사용중인 모듈과 동일해야합니다. 예 : 모듈 min sdk 버전은 14이고 app min sdk 버전은 9입니다.
- 앱과 모듈의 빌드 버전이 동일하지 않은 경우. 다시 말하지만 ** 간단히 말하면 앱
build.gradle
파일과 매니페스트의 구성이 동일해야합니다 **- 동일한 권한이 매니페스트 파일에 두 번 추가되고 동일한 활동이 두 번 언급되는 것과 같은 중복은 없습니다.
- 프로젝트에서 활동을 삭제 한 경우 매니페스트 파일에서도 삭제하십시오.
- 때로는 매니페스트 파일의 레이블, 아이콘 등 태그로 인해 :
a)
xmlns:tools
매니페스트 태그에 줄을 추가하십시오 .b)
tools:replace=
또는tools:ignore=
애플리케이션 태그를 추가하십시오 .
예:
<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>
- 두 개의 종속성이 동일한 버전 예가 아닌 경우 : 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를 사용하므로 두 라이브러리에 차이가 있으므로 오류가 발생합니다.
오류 : ': app : processDebugManifest'작업에 대한 실행이 실패했습니다.
매니페스트 합병 실패 : [com.android.support:appcompat-v7:26.0.0-alpha1]의 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). 제안 : AndroidManifest.xml : 25 : 5-27 : 41의 요소에 'tools : replace = "android : value"'를 추가하여 재정의하십시오.
따라서 버전 25.3.1의 appcompat를 사용하면이 오류를 피할 수 있습니다.
위의 사항을 고려하면이 자극적 인 문제를 제거 할 수 있습니다. 내 블로그도 확인할 수 있습니다 https://wordpress.com/post/dhingrakimmi.wordpress.com/23
나를 위해이 작품-
에서 병합 오류 찾기 AndroidManifest.xml
에서 Merged Manifest를 클릭하십시오. AndroidManifest.xml
오른쪽 열에서 매니페스트 병합 오류를 볼 수 있습니다. 이 문제를 해결하는 데 도움이 될 수 있습니다.
나는 같은 문제에 직면하고 있으며 manifest.xml에 한 줄을 추가했는데 그것은 나를 위해 일했다.
tools:replace="android:allowBackup,icon,theme,label,name">
이 줄을 아래에 추가하십시오
<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">
그것이 도움이되기를 바랍니다.
사용 가능한 솔루션 외에도 이것도 확인하십시오.
사용자가 설정 한 경우 android:allowBackup="false"
사용자에 AndroidManifest.xml
다음의 충돌이있을 수 있습니다 android:allowBackup="true"
다른 종속한다.
해결 방법
@CLIFFORD PY가 제안한대로에서로 전환 Merged Manifest
하십시오 AndroidManifest.xml
. 안드로이드 스튜디오 추가 제안합니다 tools:replace="android:allowBackup"
에서 <application />
당신에 AndroidManifest.xml
.
필자의 경우 <uses-permission>
요소에 중복성이 있기 때문에 오류가 표시되었습니다 . 따라서 AndroidManifest.xml
파일에서 동일한 내용을 확인하십시오 .
Android Studio 버전은 3.0.1입니다
운영 체제는 Windows 7입니다
다음은 참조 용 스크린 샷입니다.
일반적으로 매니페스트에 오류가있을 때 발생합니다 .AndroidManifest.xml을 엽니 다. 병합 된 매니페스트 탭을 클릭하십시오. 오류가 표시 될 수도 있습니다. 또한 여기에 언급 된 제안을 포함하십시오 .com.google.android.gms를 가져 오는 동안 비슷한 문제가 발생했을 때 .maps.model.LatLng, 응용 프로그램 태그에 tools : overrideLibrary = "com.google.android.gms.maps"를 포함하도록 제안했으며 빌드가 성공했습니다.
프로젝트 매니페스트 응용 프로그램 태그에 아래 코드를 추가하십시오 ...
<application
tools:node="replace">
리 팩터-> AndroidX로 마이그레이션 하여이 문제를 해결했습니다.
GL
내 사건으로 내가 고쳤다
build.gradle (모듈 : 앱)
defaultConfig {
----------
multiDexEnabled true
}
dependencies {
...........
implementation 'com.google.android.gms:play-services-gcm:11.0.2'
implementation 'com.onesignal:OneSignal:3.+@aar'
}
이 답변은 OnSignal 푸시 알림으로 다시 작성되었습니다.
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.
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.
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.example.appname"
minSdkVersion 16
targetSdkVersion 25
versionCode 22
versionName "2.0.3"
}
Hope, this helps.
If after you add a Android Library Module and you get this error.
You can fix it by simple remove the android:label="@string/app_name"
from the AndroidManifest.xml
of your Android Library Module
In
AndroidManifest.xml
:- At application, add
tools:replace="android:icon, android:theme
and - At the Manifest root, add
xmlns:tools="http://schemas.android.com/tools
- At application, add
In
build.gradle
:- At root, add
useOldManifestMerger true
- At root, add
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). Add that line into your manifest file under tag and sync gradle, that's it.
The minium sdk version should be same as of the modules/lib you are using For example: Your module min sdk version is 26 and your app min sdk version is 21 It should be same.
In my case it happened for leaving some empty intent-filter inside the Activity tag
<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>
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.
I found this by going to the Gradle Console (bottom right of the screen).
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. For example, if you have a variable name "id" in your Java class and you rename it with 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.
this is very simple error only occur when you define any activity call two time in mainifest.xml file Example like
<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:
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'
}
}
}}
Supplement the answer Phan Van Linh. I deleted these lines:
android:icon="@mipmap/ic_launcher"
android:label="name"
Just migrate to Androidx as shown above and then set teh minimum sdk version to 26...with no doubts this works perfectly
The following hack works:
- Add the
xmlns:tools="http://schemas.android.com/tools"
line in the manifest tag - Add
tools:replace="android:icon,android:theme,android:allowBackup,label,name"
in the application tag
I solved this by removing android:replace
tag
In my case i was using some annotations from jetbrains library. I removed those annotations and dependencies and it worked fine.
So please check the libraries in android code and dependencies carefully.
If you're using multiple manifestPlaceholder
items in your build.gradle
file, you must add them as array elements, instead of separate items.
For example, this will cause a build error or compile error: "java.lang.RuntimeException: Manifest merger 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
.
If you are using android studio v 3.2 or above, simply
go to refactor ---> MIGRATE TO ANDROID X.
Do make a backup of your project.
I was using the FirebaseUI Library
along with the Facebook SDK Library
, which was causing me the issue.
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.
With the latest update
of FirebaseUI library, previous version of Facebook SDK is also a part of it.
If you are using the both the libraries, please remove the Facebook SDK Library.
https://github.com/firebase/FirebaseUI-Android/issues/230
UPDATE
로부터 Android Studio 3.0
및 이후 버전, app.gradle
파일이 사용하는 데 필요한 implementation
또는 api
대신을 compile
응용 프로그램에 종속성을 추가.
AndroidManifest.xml에서 아래 줄을 제거 하여이 문제를 해결했습니다.
android:allowBackup="true"