我正在使用Android Studio 3.0 Canary 4版本。我导入了recyclerview库,但是遇到了“attr/colorError未找到”的错误信息。
以下是我的app 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'
}
每当我添加这两个库implementation 'com.android.support:recyclerview-v7:26.0.0-beta2'和implementation 'com.android.support:appcompat-v7:26.0.0-beta2'时,就会出现以下错误信息:![enter image description here](https://istack.dev59.com/78v0g.webp)
我尝试了清理并重新构建,但错误消息仍然存在。我检查过res/values/colors,颜色值都在那里。为什么会出现这个颜色错误?如果我想使用recycler view,应该导入哪个库版本?