私はアンドロイドアプリを開発中です。ステータステキストの色を変更したいまた、textColorPrimaryとしても知られています。しかし、エラーが表示されます。android error textColorPrimaryで一致するリソースが見つかりません
Error:(829, 21) No resource found that matches the given name: attr 'textColorPrimary'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
以下に示すマイコードです。
のAndroidManifest.xml
<activity
android:name=".home.HomeActivity"
android:theme="@style/AppTheme.GrayStatusBar"/>
値\のstyles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme.GrayStatusBar" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimaryDark">@color/colorGray</item>
<item name="textColorPrimary">@color/bg</item>
</style>
</resources>
V21の\ののstyles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
V17の\のstyles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
build.gradle私の問題を解決する方法
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
sourceSets.main {
jniLibs.srcDir 'libs'
jni.srcDirs = [] //disable automatic ndk-build call
}
android {
useLibrary 'org.apache.http.legacy'
}
defaultConfig {
applicationId "com.acs.udial"
minSdkVersion 16
targetSdkVersion 25
versionCode 15770
versionName "r15770"
testApplicationId "com.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
?私を助けてください?あなたのtextColorPrimary
色を定義colors.xmlファイルがあるはずですあなたのvalues
フォルダで
ポストあなたは 'build.gradle' .. – rafsanahmad007
たぶんあなたtextColorPrimaryは、テストパッケージ内にありますか? – resw67
@ rafsanahmad007私は質問で追加しました。それをチェックしてください。 – joe