我正在使用Android Studio 3.0 Canary4。我导入了回收者视图库。然后,它显示出attr / colorError not found消息。这是应用程序build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.robyn.myapplication"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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'
})
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:recyclerview-v7:26.0.0-beta2'
implementation 'com.android.support:appcompat-v7:26.0.0-beta2'
}
每当我添加两个库实现'com.android.support:recyclerview-v7:26.0.0-beta2'和实现'com.android.support:appcompat-v7:26.0.0-beta2'时,都会出现此错误消息:
我尝试清理并重建,错误消息仍然存在。我检查了res / values / colors,那里的颜色值。为什么会出现此颜色错误?如果要使用回收站视图,应该导入哪个版本的库?