So I'm just getting started with Android Studio to make an app with my friend. I installed the 8.0 Android SDK, and it still worked properly like 2 days ago. Now I opened the project and see this error. How can I fix it?
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:design:26.0.0-alpha1] AndroidManifest.xml:27:9-38 is also present at [com.android.support:gridlayout-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.
I was having the same problem.
Gradle:
compileSdkVersion 26
buildToolsVersion "26.0.1"
repositories {
maven { url 'https://maven.google.com' }
}
all libraries should use 26.1.0 like this:
compile 'com.android.support:support-v4:26.1.0'
Check this page: https://developer.android.com/about/versions/oreo/android-8.0-migration.html
Hope it helps.
This is my build.gradle code
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "phucdtd.myapplication"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++11 -frtti -fexceptions"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
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:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.android.support:gridlayout-v7:25.3.1'
}
Related
I wanna install login facebook sdk in my Android app, already i import the SDK to the project app, the problem i get is with appcompat
the problem is i dont know what need to do to fix the problem, i dont know how to implement the suggestion android studio give
below show the details of my code
this is my :
build.gradle (Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.perugiftart.facebooksdk"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
} }
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:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile project(':facebook-android-sdk-4.25.0')
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
}
the error appear here:
compile 'com.android.support:appcompat-v7:26.+'
this is the message error:
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:appcompat-v7:26.0.0-alpha1]
AndroidManifest.xml:27:9-38 is also present at
[com.android.support:customtabs: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.
im not sure how can fix this error on my code, please help
I'm getting a compile error after adding CardView and RecyclerView dependencies, I've checked every post but no one seems to solve this case.
Error:
Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31
is also present at [com.android.support:cardview-v7:26.0.0-alpha1] AndroidManifest.xml:24:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:25:5-27:34 to override.
My Build.Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.soft.kukito.cardviewprueba"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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:cardview-v7:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
}
Thank everyone for answering.
You need to use the same android support library version. You need to use support library 26.0.0-alpha1 version. So change the following:
compile 'com.android.support:appcompat-v7:25.3.1'
to
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
You also need to change the compileSdkVersion and targetSdkVersion to version 26.
After changing minimum sdk to 16 i've got that error
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/graphics/drawable/DrawableCompatHoneycomb.class
this is my build.gradle (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.nicoleiesperida.crazyjeepney"
minSdkVersion 16
targetSdkVersion 23
multiDexEnabled true
ndk {
moduleName "player_shared"
}
}
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Application.mk'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
}
dependencies {
compile 'com.google.android.gms:play-services:+'
compile files('libs/dagger-1.2.2.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/support-v4-19.0.1.jar')
compile 'com.facebook.android:facebook-android-sdk:4.+'
}
The same class is being provided by two different dependencies. run
gradle app:dependencies
or
./gradlew app:dependencies
where app is the app project name. Then locate the support v4 package and exclude it from the dependency. Probably it's facebook.
I am using EBS payment gateway in my android application. EBS includes volley library in its folder. Also I use volley library for my project.So I get an exception like this.
Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/android/volley/AuthFailureError.class
And below is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
repositories {
mavenCentral()
}
configurations{
all*.exclude group: 'com.android.volley', module: 'toolbox'
}
defaultConfig {
applicationId "com.example.nivedha.rents"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
//compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile project(':EBS')
}
Help me out to fix this issue..
Do like this :
When you added com.mcxiaoke.volley:library-aar:1.0.0 your some of the dependencies got clashed
So, now what you have to do is
Search CTRL+SHIFT+N in android studio for the class AuthFailureError.class
See which jar contains this and remove it like below (This is just as an example/You have to figure out the duplicate class and manually remove it)
configurations{
all*.exclude module: 'toolbox'
}
I have the following gradle file in my android app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.test.forum"
minSdkVersion 16
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
//configurations {
// all*.exclude group: 'com.android.support', module: 'support-v4'
//}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19+'
compile 'org.java-websocket:Java-WebSocket:1.3.0'
}
and the bug output is Error code: 2; Output: UNEXPECTED TOP-LEVEL EXCEPTION.
When I uncomment the configurations part of the file I get Can't find package v4 (support) although I have it installed from the sdk. Any ideas on how I can solve this?