Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to resolve: com.android.support:appcompat-v7:28.+ , Error: more than one library with package name 'android.support.graphics.drawable'

Tags:

java

android

I'm new to Android Studio, I tried everything to solve this problem "Failed to resolve: com.android.support:appcompat-v7:28.+ "

I tried to clean project , invalidate cash/restart and removing .idea and still the same

I'm using android studio 2.2.1 for a learning reason , and I updated it to android studio 3 and there a multiple rendering problems so I returned back to version 2.2.1

I tried to add

maven {
url 'https://maven.google.com/' name 'Google' }

So,It stuck with another problem

"Error:Execution failed for task ':app:processDebugResources'.
> Error: more than one library with package name 'android.support.graphics.drawable'"

Error Photo

Finally I tried to change "appcompat-v7:28.+" to "appcompat-v7:27" and it' works but still tell me that i should use the same library to avoid mistakes

This is my Gradle code:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.1"
    defaultConfig {
        applicationId "com.example.aimlive.myapplication"
        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 {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:28.+'
    testCompile 'junit:junit:4.12'
}
like image 647
Ahmed Hassan Avatar asked Jul 16 '18 21:07

Ahmed Hassan


1 Answers

Replace 'com.android.support:appcompat-v7:28+' by 'com.android.support:appcompat-v7:28.0.0'

and add below dependencies

implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
like image 67
Roshan Avatar answered Oct 22 '22 07:10

Roshan