Have recently upgraded to Android Studio 3.1, and at the same time I\'m trying the Android P preview.
I\'m getting the following error on compiling:
You need to override the conflicted libraries by adding the conflicted libraries to your dependencies block
dependencies {
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'
add in dependencies of build.grad (Module.app)
dependencies {
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
}
In my case adding support-v4 helped me to got loose of warning.
dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
// other dependencies
}
Some dependency — perhaps playLicensing — has a transitive dependency on at least support-media-compat
, for version 26.1.0
.
To work around this:
Identify each Support Library artifact that shows up in "External Libraries" that is older than 28.0.0-alpha1
. Based on the error, those older ones should all be 26.1.0
, and it will be at least support-media-compat
.
For each of those, add your own implementation
line to your dependencies, requesting that artifact, but for 28.0.0-alpha1
. This will cause Gradle to use the newer artifact, which happens to be what you want.
Hope that whatever is depending on those older artifacts will survive with the newer artifacts.
So, at minimum, you are adding:
implementation 'com.android.support:support-media-compat:28.0.0-alpha1'
In my case I resolved it by adding this below the error line.
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
Are you using a firebase in your project? Using firebase core or firebase app indexing seem to be causing the problem. I was having the same problem, but commenting on firebase packages makes the error to go away
// implementation 'com.google.firebase:firebase-core:16.0.8'
// implementation 'com.google.firebase:firebase-ads:17.2.0'
// implementation 'com.google.firebase:firebase-appindexing:17.1.0'