我是 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 许可协议
将
'com.android.support:appcompat-v7:28+'
替换为'com.android.support:appcompat-v7:28.0.0'
并添加以下依赖项