jitendra namde
jitendra namde

Reputation: 193

Android studio getting warning for support:appcompat-v7:28.0.0

I am getting error in build.gradle file

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).

Here is my gradle file

android {
            compileSdkVersion 28
            defaultConfig {
                applicationId "com.pristology.mysociety"
                minSdkVersion 15
                targetSdkVersion 28
                versionCode 3
                versionName "1.0.3"
                testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            }
            buildTypes {
                release {
                    minifyEnabled false
                    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
                }
            }
        }
            implementation fileTree(dir: 'libs', include: ['*.jar'])
            implementation 'com.android.support:appcompat-v7:28.0.0'

            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'
            implementation 'com.android.support:cardview-v7:28.0.0'

I am getting warning in app level gradle file when update android studio 3.3.2

Upvotes: 2

Views: 874

Answers (2)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363825

All com.android.support libraries must use the exact same version specification

It happens because some of your libraries use an old version support-media-compat.

Just add explicitly the version of the library in your dependencies

implementation 'com.android.support:support-media-compat:28.0.0'

Upvotes: 2

S Shikhar
S Shikhar

Reputation: 21

1st) you are getting problem because of different appcompat version so change your dependency because in gradle version 3.+ it causes problem

> implementation 'com.android.support:appcompat-v7:28.0.0'

to this version

implementation 'com.android.support:appcompat-v7:28.0.0'-alpha1

or you can use v7:27.1.1 but you have to change it everywhere in app:gradle

2nd) if you are using firebase then it will also cause problem so remove this line of code

implementation 'com.google.firebase:firebase-core:16.0.7'

because this line isn't necessary and u will get rid of this problem ;)

Upvotes: -1

Related Questions