When i try to add admob add dependency which is
implementation 'com.google.android.gms:play-services-ads:17.1.1'
https://imgur.com/XodA9vJ
error details:
All com.android.support libraries must use the exact same version >specification (mixing versions can lead to runtime crashes). Found versions >28.0.0, 26.1.0. Examples include com.android.support:animated-vector->drawable:28.0.0 and com.android.support:support-media-compat:26.1.0 less... >(Ctrl+F1)
Inspection info:There are some combinations of libraries, or tools and >libraries, that are incompatible, or can lead to bugs. One such >incompatibility is compiling with a version of the Android support libraries >that is not the latest version (or in particular, a version lower than your >targetSdkVersion). Issue id: GradleCompatible
tried to change lower appcombat version
//code
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "highproteinfoodsofalltimes.com.highproteinfoods"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '28.0.3'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.google.android.gms:play-services-ads:17.1.1'
}
add this 3 lines to your dependency build.gradle
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
Related
I'm getting an error regarding mixing of dependency versions . Few days back it was working absolutely fine but from nowhere the issue popped up .
It's showing : All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0-alpha1, 28.0.0. Examples include com.android.support:customtabs:28.0.0-alpha1 and com.android.support:animated-vector-drawable:28.0.0
I'm using Firebase dependencies also , is it causing any trouble ?
I tried to add some extra dependencies (as popped up) , but nothing is working .
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "namantiwari.epplieschool"
minSdkVersion 21
targetSdkVersion 28
versionCode 7
versionName "1.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:customtabs:28.0.0-alpha1'
implementation 'com.android.support:support-vector-drawable:28.0.0-alpha1'
implementation 'com.android.support:support-media-compat:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0-alpha1'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-messaging:17.3.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
}
apply plugin: 'com.google.gms.google-services'
Android X is supposed to solve these issues.
How to migrate to Android X
I want to add fcm to my android project. Following the guide, I added firebase to my app and inserted the dependency. But now I get the error
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 26.1.0. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-media-compat:26.1.0
on the appcompat dependency(or maybe I just haven't noticed it before)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "myApp.ginso.com.azul"
minSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Can anyone tell me, what I have to change?
Issue is that espresso-core is using older dependency of support library group. Increase it to latest version (3.0.2 or whatever latest is) or use below code instead of your existing code to explicitly remove support group from it:
androidTestImplementation ('com.android.support.test.espresso:espresso-core:3.0.1') {
exclude group: "com.android.support"
}
Hope this will solve your problem.
Some of your libraries have used an older version of dependencies.
To resolve this add this dependency and try again
implementation 'com.android.support:support-media-compat:28.0.0'
I'm trying to import the following library:
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
but I get the following error when I sync:
All com.android.support libraries must use the exact same version
specification (mixing versions can lead to runtime crashes). Found
versions 28.0.0-rc01, 27.1.0. Examples include
com.android.support:animated-vector-drawable:28.0.0-rc01 and
com.android.support:exifinterface:27.1.0...
I tried adding the following but nothing has helped. How do I fix this?
implementation 'com.android.support:exifinterface-28.0.0-rc01'
Make Sure you have compileSdkVersion 28 and targetSdkVersion 28 in android block in build.gradle file.
also make sure you have appcompat-v7:28.0.0-rc01 in your dependencies block.
Then i think implementation 'com.android.support:exifinterface:28.0.0-rc01' can be added without any problem.
I am pasting my build.gradle (Module:app) for reference.
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.chirag.example.retrofeitdemo"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:exifinterface:28.0.0-rc01'
}
I keep receiving an error: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1, 25.2.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:support-media-compat:25.2.0
This error shows on com.android.support:appcompat-v7:27.1.1 line.
I added Firebase to my app and it shows that these dependencies can be updated to newer versions.
I know about other same questions but appcompat and Firebase versions are different.
Here is the code in app/build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.airliner.chatting"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
I solved it by adding
implementation 'com.android.support:support-media-compat:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
Just copy the second library name from the error message, add it to dependencies and change it's version to the same as the first library name.
I am working on a new app. Presently I am trying to add dependency.
implementation 'com.google.android.gms:play-services:11.0.1'
When I do I get a gradle compile error on implementation 'com.android.support:appcompat-v7:27.1.1' saying:
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1, 26.1.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:mediarouter-v7:26.1.0
Any ideas how to best resolve this issue?
Gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.boulbabazitouni.getdevicelocation_time"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.android.gms:play-services:11.0.1'
}
The problem is that you have some transient dependencies in this libraries. Whenever this happens you can explicitly add the conflicting dependencies and match them with your current version:
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'