Manifest sync error - android

I wanted to go back and continue my android app after 4 month, what happend is that manifest doesn't sync with the following error:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(26.1.0) from [com.android.support:support-v13:26.1.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:design:26.0.1] AndroidManifest.xml:28:13-35 value=(26.0.1).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
and my manifest is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.arnick.bazim"
minSdkVersion 21
targetSdkVersion 26
versionCode 7
versionName "0.9.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [onesignal_app_id : #the one signal app id,
onesignal_google_project_number: "REMOTE"]
}
applicationVariants.all { variant ->
variant.resValue "string", "versionName", variant.versionName
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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:support-v13:26.1.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:cardview-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:customtabs:26.1.0'
compile 'com.google.firebase:firebase-auth:11.6.2'
compile 'com.google.android.gms:play-services-auth:11.6.2'
compile('io.socket:socket.io-client:1.0.0') {
// excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json'
}
compile 'com.onesignal:OneSignal:3.6.5'
compile 'com.android.volley:volley:1.0.0'
testCompile 'junit:junit:4.12'
}
if that matters, I'm using local gralde version 4.2.1
I have also checked gradle 4.3.1 and non-local gradle but the error is still there.
Is there anything I am missing?
I remember about 5 6 months ago I faced the same issue I guess, and that was related to onesignal version but I do not remember what happened I just know I changed the version and error disappeared.

use same version as at top of gradle file 26.0.2
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.arnick.bazim"
minSdkVersion 21
targetSdkVersion 26
versionCode 7
versionName "0.9.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [onesignal_app_id : #the one signal app id,
onesignal_google_project_number: "REMOTE"]
}
applicationVariants.all { variant ->
variant.resValue "string", "versionName", variant.versionName
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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:support-v13:26.0.2'
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:cardview-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.android.support:support-v4:26.0.2'
compile 'com.android.support:customtabs:26.0.2'
compile 'com.google.firebase:firebase-auth:11.6.2'
compile 'com.google.android.gms:play-services-auth:11.6.2'
compile('io.socket:socket.io-client:1.0.0') {
// excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json'
}
compile 'com.onesignal:OneSignal:3.6.5'
compile 'com.android.volley:volley:1.0.0'
testCompile 'junit:junit:4.12'
}
clean and rebuild this may help...

Use the same version of support libraries:
Change
compile 'com.android.support:cardview-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
with
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:design:26.1.0'

Related

android manifest merger failed after adding Firebase UI to my dependency

I have upgraded to android studio canary and trying to add firebase UI to my app but am getting the following error:
Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(26.0.1) from [com.android.support:customtabs:26.0.1] AndroidManifest.xml:25:13-35
is also present at [com.android.support:design: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.
It seems to be some dependency problem but cant figure it out yet. My gradle file is as follow
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.rainbow.dili"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
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.google.firebase:firebase-database:12.0.1'
compile 'com.google.firebase:firebase-storage:12.0.1'
compile 'com.firebaseui:firebase-ui:2.3.0'
compile 'com.tbuonomo.andrui:viewpagerdotsindicator:1.0.1'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.1.0-beta6'
compile 'com.droidninja:filepicker:2.0.7'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'me.relex:circleindicator:1.2.2#aar'
compile 'jp.wasabeef:picasso-transformations:2.1.0'
compile 'com.android.support:support-vector-drawable:26.1.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
I have been advised to get the same version for
compileSdkVersion 26
and
buildToolsVersion "26.0.1"
but still get the same error. What might be causing this ?
You are using an old version of firebaseui that is not compatible with version 12.0.1 of firebase, to solve this:
Change the following:
compile 'com.firebaseui:firebase-ui:2.3.0'
to this:
compile 'com.firebaseui:firebase-ui:3.3.0'
more info here:
https://github.com/firebase/FirebaseUI-Android#compatibility-with-firebase--google-play-services-libraries

No resource found that matches the given name (at 'dialogCornerRadius' with value '?android:attr/dialogCornerRadius')

Can anybody help why I am getting an error in the following?
Error:(7, 41) No resource found that matches the given name (at
'dialogCornerRadius' with value '?android:attr/dialogCornerRadius').
apply plugin: 'com.android.application'
//Add these lines
def Base_URL = '"' + WEBServiceBaseURL + '"' ?: '"Define BASE URL"';
def SMS_Base_URL = '"' + WEBServiceBaseSMSURL + '"' ?: '"Define SMS BASE URL"';
android.buildTypes.each { type ->
type.buildConfigField 'String', 'Base_URL', WEBServiceBaseURL
type.buildConfigField 'String', 'SMS_Base_URL', WEBServiceBaseSMSURL
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.bla.bla"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:+'
compile files('libs/jxl-2.6.jar')
compile 'com.google.gms:google-services:+'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
}
apply plugin: 'com.google.gms.google-services'
I fixed this issue by selecting
API 27+: Android API 27, P preview (Preview)
in the project structure settings. Following image shows my setting. The 13 errors that were coming while building the app, have disappeared.
set your compileSdkVersion 28
let android studio download platform files
if in your app level gradle if you have used compileSdkVersion = 27 then it will not work.
You have to use version 28.
compileSdkVersion 28
buildToolsVersion '28.0.3'
Change the line compile 'com.android.support:design:+' to compile 'com.android.support:design:26.+'
The gradle dependencies when the project is built is pulling down the latest versions since the + was telling it "get the latest version." the 26.+ will tell the build process to only update the latest version of v26.
Or to be even more specific and safe, change the line to a specific version, avoiding the + altogether. i.e. compile 'com.android.support:design:27.1.0'
Change the following depedencies in your gradle:
compile 'com.android.support:design:+'
to:
compile 'com.android.support:design:26.1.0'
'com.android.support:appcompat-v7:26.+'
to:
'com.android.support:appcompat-v7:26.1.0'
Please note that you can specify any version, but make sure they both have the same version.
This will make sure that values-28.xml file is not created.
After Everybody's help, I could resolve this issue & run app in lower version.
My updated build.gradle is like below.
Special thanks to all Genius out there!
apply plugin: 'com.android.application'
android.buildTypes.each { type ->
type.buildConfigField 'String', 'Base_URL', WEBServiceBaseURL
type.buildConfigField 'String', 'SMS_Base_URL', WEBServiceBaseSMSURL
}
android {
compileSdkVersion 27
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.dummy.dummy"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
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 'com.android.support:design:26.+'
compile files('libs/jxl-2.6.jar')
compile 'com.google.gms:google-services:+'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
}
apply plugin: 'com.google.gms.google-services'
forget about dynamic dependencies and replace them with fixed specific versions :
WRONG :
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'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:+'
compile files('libs/jxl-2.6.jar')
compile 'com.google.gms:google-services:+'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
}
CORRECT :
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.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:26.1.0'
compile files('libs/jxl-2.6.jar')
compile 'com.google.gms:google-services:3.1.1'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
}
Got the same error after unsuccessful migration to AndroidX.
I reverted all changes which Android Studio made, cleaned project, invalidated cache/restart, and many other things but with no luck.
Finally I found that Android Studio added two lines to gradle.properties:
android.useAndroidX=true
android.enableJetifier=true
After remove those lines everything back to normal.
I tried all but it did not work. Finally, it worked after I changed target to 28 in platforms/android/project.properties.
change
target=android-26
to
target=android-28
Thanks

Error:Conflict with dependency 'com.android.support:support-annotations' in project ':app'

I was trying to solve this gradle error.I imported this project by getting it from a friend of mine.It worked in his system perfectly. Seems like I have a The following issues in my gradle.
Error:Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (27.0.2) and test app (25.4.0) differ.
The following are my gradle
Module app
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
applicationId "com.startup.hospital"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
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:27.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:27.+'
compile 'com.android.support:support-vector-drawable:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.aurelhubert:ahbottomnavigation:2.1.0'
compile 'com.github.arimorty:floatingsearchview:2.1.1'
compile 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Project gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.1"
defaultConfig {
applicationId "com.startup.hospital"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
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:27.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:27.+'
compile 'com.android.support:support-vector-drawable:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.aurelhubert:ahbottomnavigation:2.1.0'
compile 'com.github.arimorty:floatingsearchview:2.1.1'
compile 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Just add the following in your build.gradle (:app)
configurations.all {
resolutionStrategy {
force 'com.android.support:appcompat-v7:26.+'
force 'com.android.support:support-compat:26.+'
force 'com.android.support:support-core-ui:26.+'
force 'com.android.support:support-annotations:26.+'
force 'com.android.support:recyclerview-v7:26.+'
}
}
Your espresso has already those dependencies same as you have declared above for support library with different version which is causing problem so exclude theme like below from module build.gradle file
androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
here is what it should look like
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
applicationId "com.startup.hospital"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
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:27.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:27.+'
compile 'com.android.support:support-vector-drawable:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.aurelhubert:ahbottomnavigation:2.1.0'
compile 'com.github.arimorty:floatingsearchview:2.1.1'
compile 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
and Your project level build.gradle file should not have those dependencies declared again.
just added this
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:22.1.0'
}

Gradle sync error when adding Material Spinner dependency

When trying to add the dependency for the latest version (2.0.0) of the Material Spinner, my gradle sync fails with the error:
Error:(33, 14) Failed to resolve: com.github.ganfra:material-spinner:2.0.0
This is my build.grade
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.myroommate.myroommate"
minSdkVersion 23
targetSdkVersion 23
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(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:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.volley:volley:1.0.0'
compile ('com.github.ganfra:material-spinner:2.0.0') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
}
But when I change the Material Spinner version to 1.1.1, the gradle sync is finishing without any errors.
compile ('com.github.ganfra:material-spinner:1.1.1') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
Even using 1.1.2 makes my gradle build fails. I would like to use the latest version of the Material Spinner so what am I doing wrong here?
the release has not been pushed to maven yet.
It'll be ok very soon.
check this

compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7' not resolve

this code of my build.gradle(moudule app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.hn.myapplication"
minSdkVersion 14
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(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.constraint:constraint-layout:1.0.2'
compile 'com.android.support:appcompat-v7:25.+'
compile 'com.android.support:recyclerview-v7:25.+'
compile 'com.android.support:support-v4:25.+'
compile 'com.android.support:design:25.+'
//compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.support.constraint:constraint-layout:1.0.0'
testCompile 'junit:junit:4.12'
}
and this is my sdk tools.
I try compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
and compile 'com.android.support.constraint:constraint-layout:1.0.0'
and compile 'com.android.support.constraint:constraint-layout:1.+'
but not working. and error is
Failed to resolve: com.android.support.constraint:constraint-layout:1
who I solve this problem?
When I use compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7
this error done: install artifact and sync project
go to file -> setting -> sdk manager -> sdk tools -> then install google repository

Categories

Resources