【发布时间】:2017-11-22 11:01:57
【问题描述】:
我使用的是 Android Studio 3.0 Canary 4。我导入了回收站视图库。然后出现 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,颜色值在那里。为什么我会收到此颜色错误?如果我想使用回收站视图,我应该导入什么版本的库?
【问题讨论】:
-
你应该理想地匹配 compileSdkVersion
标签: android gradle android-recyclerview