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:
this error came,when i connect app to firebase.
no need to add any thing.
just put mouse cursor on error line(below one) and press Alt+Enter
(implementation 'com.android.support:appcompat-v7:28.0.0')
in the list enter first option.(noinspection)
After that it looks like this,
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
I think your gradle file has the below dependency. Add this to your app level build.gradle.
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:mediarouter-v7:28.0.0-alpha1'
implementation 'com.android.support:support-vector-drawable:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0-alpha1'
You need to override the conflicted libraries by adding the conflicted libraries to your dependencies block. For example, from your error log you'll find the following:
Found versions 28.0.0-alpha1, 26.1.0. Examples include com.android.support:animated-vector-drawable:28.0.0-alpha1 and com.android.support:support-media-compat:26.1.0 less...
You can remove the error by adding the libraries with something like this:
dependencies {
implementation 'com.android.support:animated-vector-drawable:28.0.0-alpha1`
implementation 'com.android.support:support-media-compat:28.0.0-alpha1`
}
The above warning is not specific to media-compat dependency. They just added example to explain the issue. The issue get resolved by adding v4 lib for me.
implementation 'com.android.support:support-v4:28.0.0'
in addition to
implementation 'com.android.support:appcompat-v7:28.0.0'
No need include
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'