Android : 새 버전의 gradle로 업데이트 한 후 "Manifest merger failed"오류가 발생 함
프로젝트를 새 버전의 gradle로 업데이트하는 것을 수락하면 다음 오류가 발생합니다.
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.0-alpha1) from [com.android.support:cardview-v7:26.0.0-alpha1] AndroidManifest.xml:24:9-38
is also present at [com.android.support:design:25.3.1] AndroidManifest.xml:27:9-31 value=(25.3.1).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:22:5-24:41 to override.
이 문제를 어떻게 해결할 수 있습니까? 이것은 내 앱의 build.gradle
파일입니다.
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.sample.bookReader"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
...
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:multidex:+'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.android.support:design:25+'
compile 'com.jakewharton:butterknife:8.2.1'
apt 'com.jakewharton:butterknife-compiler:8.2.1'
...
}
그리고 이것은 프로젝트의 build.gradle
:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://www.jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
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'
}
}
}
}
여러 버전의 Android 지원 라이브러리를 사용하고 있습니다.
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.android.support:design:25+'
두 개는 26.0.0-alpha1
이고 하나는 25+
.
하나의 구체적인 버전을 선택하고이 세 가지 모두에 사용하십시오. 당신이 때문에 compileSdkVersion
아닌 O
, 사용 25.3.1
이 라이브러리의 세 가지에 대한이 결과 :
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
I changed all support library versions to 25.3.1 and worked like a charm:
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
You also need to change compileSdkVersion and targetSdkVersion to 25:
compileSdkVersion 25
targetSdkVersion 25
You can find out what library depends on a wrong version of the support library and exclude it like this:
compile ('com.stripe:stripe-android:5.1.1') {
exclude group: 'com.android.support'
}
stripe-android
in my case.
I'm not using different versions of libraries and got the same error, it's happened after remove buildToolsVersion
in AS RC 1, but adding tools:node="replace"
did the trick, just add this into your manifest.xml inside <application ..../>
block:
<meta-data
tools:node="replace"
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
It happen the same thing to me. See on Gradle -> Build Gradle -> and make sure that the compatibility matches in both compile "app compat" and "support design" lines, they should have the same version.
Then to be super sure, that it will launch with no problem, go to File -> Project Structure ->app and check on tab propertie the build Tools version, it should be the same as your support compile line, just in case i put the target SDK version as 25 as well on the tab Flavors.
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-
core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
*compile 'com.android.support:appcompat-v7:25.3.1'*
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
*compile 'com.android.support:design:25.3.1'*
}
Thats what I did and worked. Good luck!
Update your support library to last version
Open
Manifest File
, and add it into Manifest File<uses-sdk tools:overrideLibrary="android.support.v17.leanback"/>
And add for recyclerview in >>
build.gradle Module app
:compile 'com.android.support:recyclerview-v7:25.3.1'
And click :
Sync Now
I solve that with putting this at the end of my 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 '26.0.0'
}
}
}
}
The answer are accepted but one thing you could also do is to define the libraries from your project structure. What you can do is :
- Comment all the libraries in which problem is coming
- Goto your project structure
- Add libraries from there and it'll sync automatically and the problem goes off.
- If problem persists try looking from the error log that what library is it demanding after following all the above 3 steps.
What happens is the predefined libraries as off now now I'm taking the appcompat:26.0.0-alpha1 it uses the older version of the things when you add something new and tries to resolve it with the old stuffs. When you add it from your project structure, it'll add the same thing but with the new stuffs to resolve it. Your problem would be resolved.
The error for me was:
Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.2) from [com.android.support:percent:26.0.2] AndroidManifest.xml:25:13-35
is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:23:9-25:38 to override.
The solution for me was in my project Gradle file I needed to bump my com.google.gms:google-services version.
I was using version 3.1.1:
classpath 'com.google.gms:google-services:3.1.1
And the error resolved after I bumped it to version 3.2.1:
classpath 'com.google.gms:google-services:3.2.1
I had just upgraded all my libraries to the latest including v27.1.1 of all the support libraries and v15.0.0 of all the Firebase libraries when I saw the error.
I have updated old android project for the Wear OS. I have got this error message while build the project:
Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.2) from [com.android.support:percent:26.0.2] AndroidManifest.xml:25:13-35
is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:23:9-25:38 to override.
My build.gradle for Wear app contains these dependencies:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.support:wearable:2.4.0'
implementation 'com.google.android.gms:play-services-wearable:16.0.1'
compileOnly 'com.google.android.wearable:wearable:2.4.0'}
SOLUTION:
Adding implementation 'com.android.support:support-v4:28.0.0'
into the dependencies solved my problem.
Try deleting the meta data and rebuild project.
you try read link this
Error:Execution failed for task ‘:app:processDevDebugManifest’. Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.3.0) then usd VERSION 26.0.0
'program story' 카테고리의 다른 글
텍스트 영역의 문자 계산 (0) | 2020.08.08 |
---|---|
Android-부팅시 서비스 시작 (0) | 2020.08.08 |
문자열 끝에서 쉼표를 제거하려면 어떻게합니까? (0) | 2020.08.08 |
자바 코드에서 "loop :". (0) | 2020.08.08 |
R을 사용하여 데이터 프레임 행을 조건부로 제거 (0) | 2020.08.08 |