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'
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
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'
I just created an Android project using Android Studio (v3.1.4) which consists of 1 activity: LoginActivity (generated from wizard).
Here's the content of my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "app.anta40.com.home_client_app"
minSdkVersion 14
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-rc01'
implementation 'com.android.support:design:28.0.0-rc01'
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'
}
I'd like to use Firebase Database, so I added this line on build.gradle:
implementation 'com.google.firebase:firebase-database:16.0.1'
Then Android Studio red-underlined the appcompat-v7 part, saying:
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, 26.1.0. Examples include
com.android.support:animated-vector-drawable:28.0.0-rc01 and
com.android.support:support-media-compat:26.1.0 less... (Ctrl+F1)
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).
How to solve this?
There are incompatibility issues between your app compat which is: 'com.android.support:appcompat-v7:28.0.0-rc01' and firebase database version which is: 'com.google.firebase:firebase-database:16.0.1'.
One solution for this would be to use a lower targetsdk version like 27 and app compat, for example
implementation 'com.android.support:appcompat-v7:27.1.1'
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.
Hello I am having a problem with my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.dell"
minSdkVersion 19
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-firestore:12.0.1'
implementation 'com.firebaseui:firebase-ui-firestore:3.3.0'
implementation 'hanks.xyz:htextview-library:0.1.5'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Android Studio gives me this warning:
All com.android.support libraries must use the exact same version
specification (mixing versions can lead to runtime crashes). Found
versions 27.1.0, 26.1.0. Examples include
com.android.support:recyclerview-v7:27.1.0 and
com.android.support:animated-vector-drawable:26.1.0
Can somebody please help me? I don't know what to do. I tried even making it v 27. I even deleted it, but it still didn't solve my problem.
I am also seeing this error:
Error:Execution failed for task
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge
dex
Android Studio warning
All com.android.support libraries must use the exact same version
specification (mixing versions can lead to runtime crashes). Found
versions 27.1.0, 26.1.0. Examples include
com.android.support:recyclerview-v7:27.1.0 and
com.android.support:animated-vector-drawable:26.1.0
Problem
One of your dependencies (com.firebaseui:firebase-ui-firestore:3.3.0) has a transitive dependency on com.android.support:recyclerview-v7:27.1.0. Meanwhile, the support libraries that you manually declare in your build file use version 26.1.0.
Solution
Update compileSdkVersion and targetSdkVersion to 27 and your support libraries to 27.1.1
android {
compileSdkVersion 27
defaultConfig {
targetSdkVersion 27
...
}
...
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
...
}
Tip (optional)
Since com.android.support:design has transitive dependencies on com.android.support:appcompat-v7 and com.android.support:support-v4, you do not have to manually declare the appcompat-v7 or support-v4 dependencies if you declare the design dependency.