我正在完全重建一个旧项目,并且只保留了xml
个文件(没有错误)。我选择更新为androidx,并正确同步了所有依赖项,但recyclerview
除外。每当我尝试同步时,都会显示下面列出的错误日志。
android:useAndroidX=true
和android:useJetifier=true
都在gradle.properties
文件中设置。在任何xml
文件中未检测到错误。我尝试过使缓存无效/重新启动,重新引导整个系统以及清理项目。我实际上不知道该怎么办。
仅当我添加以下一个或两个依赖项时,才会发生错误:
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha05'
implementation 'androidx.recyclerview:recyclerview-selection:1.1.0-alpha05'
我尝试分别添加和删除每个依赖项。只有那些产生了错误。
错误
ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve androidx.recyclerview:recyclerview:1.1.0-alpha05.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve androidx.recyclerview:recyclerview-selection:1.1.0- alpha05.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve androidx.recyclerview:recyclerview:1.1.0-alpha05.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve androidx.recyclerview:recyclerview-selection:1.1.0-alpha05.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve androidx.recyclerview:recyclerview:1.1.0-alpha05.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve androidx.recyclerview:recyclerview-selection:1.1.0-alpha05.
Show Details
Affected Modules: app
build.gradle(app)文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.shababuna"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0-beta01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0-beta01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.airbnb.android:lottie:3.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha05'
implementation 'androidx.recyclerview:recyclerview-selection:1.1.0-alpha05'
}