未能解决:com.android.support:appcompat-v7:28。 ,错误:包名称为“android.support.graphics.drawable”的库不止一个

新手上路,请多包涵

我是 Android Studio 的新手,我尝试了一切来解决这个问题“无法解决:com.android.support:appcompat-v7:28.+”

我尝试清理项目、使现金无效/重新启动并删除 .idea 并且仍然相同

出于学习原因,我正在使用 android studio 2.2.1,并将其更新为 android studio 3 并出现多个渲染问题,因此我返回到 2.2.1 版

我试图添加

行家{

url ‘ https://maven.google.com/ ’ 名称 ‘Google’ }

所以,它遇到了另一个问题

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

错误照片

最后我尝试将“appcompat-v7:28.+”更改为“appcompat-v7:27”并且它有效但仍然告诉我我应该使用相同的库以避免错误

这是我的摇篮代码:

 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'
}

原文由 Ahmed Hassan 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 632
1 个回答

'com.android.support:appcompat-v7:28+' 替换为 'com.android.support:appcompat-v7:28.0.0'

并添加以下依赖项

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'

原文由 Roshan 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题