I have android studio 3.3.2 and my goal is to import the GraphView library but, it turns out that it has given me an error that all the libraries must have the same version specification, I present an image of the error
error Tooltip info
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 27.1.1. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-media-compat:27.1.1 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
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.mrl.fredy.estadistica"
minSdkVersion 18
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.jjoe64:graphview:4.2.2'
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'
}
Instead of this
compileSdkVersion 28
targetSdkVersion 28
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
Use
compileSdkVersion 27
targetSdkVersion 27
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
GraphView library support library version is 27.
so you can downgrade your library version. if you do not want to downgrade then import GraphView as a module and in build.gradle file change to compileSdkVersion 28 and targetSdkVersion 28
Related
I'm new to Android programming. When I tried to add material design library to
build.gradle it shows error under implementation 'com.android.support:appcompat-v7:28.0.0'.
Error message is :
Dependencies using groupId com.android.support and androidx.* can not be combined but found IdeMavenCoordinates{myGroupId='com.android.support', myArtifactId='support-fragment', myVersion='28.0.0', myPacking='aar', myClassifier='null'} and IdeMavenCoordinates{myGroupId='androidx.arch.core', myArtifactId='core-runtime', myVersion='2.0.0', myPacking='aar', myClassifier='null'} incompatible dependencies 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
I don't want to remove appcompat since I want to support lower versions.
here is my gradle code:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
buildToolsVersion "29.0.0"
defaultConfig {
applicationId "com.vignesh.materialdesigntest"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.google.android.material:material:1.1.0-alpha07"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
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'
}
In Android Studio, navigate to Refactor menu and select Migrate to AndroidX
You need to move to AndroidX
Go to android studio menu
Refactor
under this menu
Go to
Migrate to AndroidX
For more information AndroidX
Hope it will help !
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 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'
}