I have been trying to bring back an old app of mine, that I wrote a while back using eclipse. I imported to android-studio and I it complains about colliding versions:
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, 27.1.0. Examples include com.android.support:animated-vector-drawable:28.0.0-alpha1 and com.android.support:cardview-v7:27.1.0
At first, I solved it as suggested by this question, by including the colliding packages specifically in the gradle file with the newer version. So my gradle file ended up like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.tomklino.imhere"
minSdkVersion 16
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dependencies {
implementation 'com.android.support:appcompat-v7:+'
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.android.support:customtabs:27.1.0'
implementation 'com.android.support:support-media-compat:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation "com.google.android.gms:play-services-gcm:11.8.0"
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
}
apply plugin: 'com.google.gms.google-services'
}
This removed the red line from under the appcompat
line, but then, after debugging something else, I got the message above again, but this time with the version 28.0.0-alpha1. Now I can't include the new version, because if I try it says it is incompatible with the sdk version of 27.
I'm trying to understand why it asks for that version in the first place if I havn't included that sdk version anywhere. Nothing in the dependency tree asks for the 28.0.0-alpha1 version specifically.
but then, after debugging something else, I got the message above again, but this time with the version 28.0.0-alpha1
Replace:
implementation 'com.android.support:appcompat-v7:+'
with:
implementation 'com.android.support:appcompat-v7:27.1.0'
and resolve to stop using +
for the entire version of an artifact.
I'm trying to understand why it asks for that version in the first place if I havn't included that sdk version anywhere.
You used +
for the version of appcompat-v7
. This says that you want the latest that Gradle can find. And, last week, Google released 28.0.0-alpha1
, in tandem with the release of the Android P Developer Preview 1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With