So, I have a problem while running the Android Project. It is said
that
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:support-media-compat:26.1.0
I found a file in .\idea\libraries >>>>> com_android_support_support_media_compat_26_1_0
I have tried to remove or rename the file of com.android.support:support-media-compat:26.1.0 to 27.1.1, but it failed.
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.sbyparking.car.surabayaparking"
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(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
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:recyclerview-v7:27.1.1'
implementation 'com.android.support:gridlayout-v7:27.1.1'
}
Do you guys have any ideas what should I do? Since I am new to Android Studio.
Thanks in advance
1st Solution :
check Offline mode is on or off if this on then please off.
Now go on Tools>SDK Manager>Open one Dialog box in this Dialog Select SDK Platform And Check Android 7.1.1(Nougat) and Download.
Now Go on : File & Select Sync Project with Gradle Files
Above Solution work for you.
2nd Solution :
If you want to implementation 'com.android.support:appcompat-v7:26.1.0' then follow bellow steps:
Change :
compileSdkVersion 27 TO compileSdkVersion 26
minSdkVersion 21 TO minSdkVersion 15
targetSdkVersion 27 TO targetSdkVersion 26
Finally Change :
implementation 'com.android.support:appcompat-v7:27.1.1'
TO
implementation 'com.android.support:appcompat-v7:26.1.0'
Now Go on : File & Select Sync Project with Gradle Files
Clean & Rebuild Project
Related
actually i'm still a beginer on android studio. i tried using the default android 4.4 but when i add some implementation on the build.gradle the notification says failed to resolve: com.google.sceneform.ux:sceneform-ux:1.6.0. i've been trying some advice and some tutorial but still can't resolve the problem.
Here is the code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.arcraw"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation'com.google.sceneform.ux:sceneform-ux:1.6.0'
implementation'com.karumi:dexter:6.0.1'
}
Based on Sceneform overview, you should change the line in gradle file from
implementation'com.google.sceneform.ux:sceneform-ux:1.6.0'
to
implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.6.0'
Update: The latest version is 1.14.0, just in case you want to use it
implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.14.0'
Hi this issue is fixed in 1.9.0 version or you can use latest version 1.14.0
try
implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.14.0
As in [1]: https://github.com/google-ar/sceneform-android-sdk
you can see that google abounded sceneform android sdk
and the library is archived as they said : This repository has been archived and is no longer maintained.
status: inactive
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 am using mancj/MaterialSearchBar to set up a search bar which looks like the Playstore's one. However, I'm having some trouble with my Gradle build.
The error
build.gradle (Module: app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.."
minSdkVersion 27
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
renderscriptTargetApi 27
renderscriptSupportModeEnabled true
}
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.3'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
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.github.mancj:MaterialSearchBar:0.7.6'
}
Solution tried
I already tried to replace the implementation of this API with the following line: implementation 'com.github.mancj:MaterialSearchBar:0.7.6:27.1.1' but it didn't find it (meaning it doesn't exist).
The library (version 0.7.6) is using 3 dependencies (AppCompat-v7, RecyclerView-v7 and CardView-v7) related to the version 25.4.0.
Because you are already using AppCompat-v7 and RecyclerView (RecyclerView is included into Design), the library is going to use the version 27 instead of 25.
You only have one more library to convert from 25 to 27, CardView-v7.
If to add implementation 'com.android.support:cardview-v7:27.1.1',
this will force the library to use the version 27 instead of 25, and therefor allow you to compile.
You still need to take care by testing your app to see if its behavior is correct, as the library was not tested to use 27 yet.
use latest version
implementation 'com.github.mancj:MaterialSearchBar:0.8.2'
add this code to the the project level build.gradle file
maven { url "https://jitpack.io" }
one can substitute the conflicting version alike this (and hope it will still work with 27.1.1):
implementation "com.android.support:cardview-v7:27.1.1"
implementation ("com.github.mancj:MaterialSearchBar:0.7.6") {
exclude group: "com.android.support", module: "cardview-v7"
}
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 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.