我正在尝试在我的 Android Studio 项目中为 SDK 版本 28 添加 CardView 和 RecyclerView 依赖项。在构建项目时,我收到消息“Gradle 项目同步失败。基本功能将无法正常工作”。
build.gradle(模块:应用程序)文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.kavyabarnadhyahazarika.quarterallotmentiocl"
minSdkVersion 16
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'
}
}
buildToolsVersion '28.0.0'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.mcxiaoke.volley:library:1.0.19'
testImplementation 'junit:junit:4.12'
}
错误消息:解析失败:com.android.support:cardview-v7:28.0.0 解析失败:com.android.support:recyclerview-v7:28.0.0
我已经尝试过构建和清理项目。
另外,如果 SDK 版本 28 不支持这些依赖项,我该如何解决该问题?
原文由 Kavya Barnadhya Hazarika 发布,翻译遵循 CC BY-SA 4.0 许可协议
There is no
28.0.0
final release as of yet - just like yourappcompat-v7
dependency,cardview-v7
andrecyclerview-v7
should have a version of28.0.0-alpha3
: