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'
Related
I am getting error in build.gradle file
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).
Here is my gradle file
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.pristology.mysociety"
minSdkVersion 15
targetSdkVersion 28
versionCode 3
versionName "1.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design: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:cardview-v7:28.0.0'
I am getting warning in app level gradle file when update android studio 3.3.2
All com.android.support libraries must use the exact same version specification
It happens because some of your libraries use an old version support-media-compat.
Just add explicitly the version of the library in your dependencies
implementation 'com.android.support:support-media-compat:28.0.0'
1st) you are getting problem because of different appcompat version so change your
dependency because in gradle version 3.+ it causes problem
> implementation 'com.android.support:appcompat-v7:28.0.0'
to this version
implementation 'com.android.support:appcompat-v7:28.0.0'-alpha1
or you can use v7:27.1.1 but you have to change it everywhere in app:gradle
2nd) if you are using firebase then it will also cause problem so remove this line of code
implementation 'com.google.firebase:firebase-core:16.0.7'
because this line isn't necessary and u will get rid of this problem ;)
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'
So I'm trying to implement admob into my android project. I am following Google's official guide for this purpose (https://developers.google.com/admob/android/quick-start#import_the_mobile_ads_sdk)
but I am getting an error on adding this line into my build.gradle(Module app),
implementation 'com.google.android.gms:play-services-ads:17.1.1'
issue description :
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:customtabs: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). Issue id: GradleCompatible
My Target SDK is API 14
My build.gradle(Module:app)
https://justpaste.it/684d6
replace with this.
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.bitpix.tales"
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'
compile 'com.android.support:customtabs:28.0.0'
compile 'com.android.support:support-v4:28.0.0'
compile 'com.android.support:support-media-compat:28.0.0'
compile 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:28.0.0'
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-ads:17.1.2'
}
apply plugin: 'com.google.gms.google-services'
Just copy and paste error version shown in gradle. For this scenario it is 'com.android.support:customtabs:26.1.0 '.
Implement this line in your gradle file it will solve the issue.
//add this line
implementation 'com.android.support:customtabs:26.1.0'
//change the version to your appcompat support version it will solve the problem
implementation 'com.android.support:customtabs:28.0.0'
compile gradle once. This error will be resolved.
there is number of dependency in support library Bundle, this library have not same version, but you can run without resolved this error. your app run fine.
I now have the following build.gradle Initially the compileSdkVersion and targetSdkVersion were set to 26 but I was getting a red line under
implementation 'com.android.support:cardview-v7:27.0.+'
implementation 'com.android.support:recyclerview-v7:27.0.+'
I then chaged compileSdkVersion and targetSdkVersion to 27, the red lines for the above two lines went away but now I have a red line under the following line
implementation 'com.android.support:appcompat-v7:27.0.2'
Below is my current
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.future.edge"
minSdkVersion 23
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.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
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'
compile 'com.klinkerapps:android-smsmms:4.3.0'
implementation 'com.android.support:cardview-v7:27.0.+'
implementation 'com.android.support:recyclerview-v7:27.0.+'
}
apply plugin: 'com.google.gms.google-services'
What do you need to do to get rid of the red line under it?
implementation 'com.android.support:appcompat-v7:27.0.2'?
When I hover over it it says
All com.android.support libraries must use the exact same version
specification (mixing versions can lead to runtime crashes). Found
versions 27.0.2, 25.2.0. Examples include
com.android.support:animated-vector-drawable:27.0.2 and
com.android.support:support-media-compat:25.2.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.)
Current version of com.android.support:appcompat is 27.1.0.
Try this:
android {
compileSdkVersion 27
defaultConfig {
targetSdkVersion 27
}
dependencies {
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.android.support:recyclerview-v7:27.1.0'
}
Also it's not the best practice to use notation like "27.0.+" to specify versions. You don't have control over versions so between builds you can get different implementations. Such change can affect your code and you won't know what is the source of the problem.
Edit:
The problem is here:
compile 'com.klinkerapps:android-smsmms:4.3.0'
you are including whole project which has it's own versions and you just can't mix them. Check inside of this repo for versions or just build this as .aar file and include as library to your project.
when I add the line below in my build.gradle (Module: app) file -
compile 'com.payumoney.sdkui:plug-n-play:1.0.0'
i am getting the error -
"All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 26.1.0, 23.2.1. Examples include com.android.support:animated-vector-drawable:26.1.0 and com.android.support:cardview-v7:23.2.1 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.)"
Help me solve the issue.
Below is the code of my build.gradle (Module:app) file -
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "learnturtle.payutrial"
minSdkVersion 16
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(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
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'
compile 'com.payumoney.sdkui:plug-n-play:1.0.0'
}