无法解决:com.android.support:appcompat-v7:28.+,错误:包名称为"android.support.graphics.drawable"的多个库 [英] Failed to resolve: com.android.support:appcompat-v7:28.+ , Error: more than one library with package name 'android.support.graphics.drawable'
问题描述
我是Android Studio的新手,我竭尽全力解决此问题无法解决:com.android.support:appcompat-v7:28.+"
I'm new to Android Studio, I tried everything to solve this problem "Failed to resolve: com.android.support:appcompat-v7:28.+ "
我试图清理项目,使现金/重新启动无效,并删除.idea并保持不变
I tried to clean project , invalidate cash/restart and removing .idea and still the same
出于学习原因,我正在使用android studio 2.2.1,并将其更新为android studio 3,并且出现了多个渲染问题,因此我回到了2.2.1版本.
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
我尝试添加
行家{
网址" https://maven.google.com/"名称为"Google"}
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'"
最后,我尝试将"appcompat-v7:28. +"更改为"appcompat-v7:27",它可以正常工作,但仍然告诉我应该使用相同的库来避免错误
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
这是我的Gradle代码:
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'
}
推荐答案
尝试将其添加到您的代码中:
try adding this to your code:
repositories {
jcenter()
maven { // <-- Add this
url 'https://maven.google.com/'
}
}
更新:现在您转到了另一个错误:
Update: Now you moved on to another error:
错误:多个库的软件包名称为'android.support.graphics.drawable ...
Error: more than one library with package name 'android.support.graphics.drawable ...
要解决此问题,您需要在 dependencies
部分将 compile
更改为 implementation
.
To fix this, you need to change compile
to implementation
in dependencies
part.
这篇关于无法解决:com.android.support:appcompat-v7:28.+,错误:包名称为"android.support.graphics.drawable"的多个库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!