我无法构建我的项目,因为我收到此错误
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(33) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Error:Execution failed for task ':app:processStageDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/john/Library/Android/sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1
/Users/john/AndroidStudioProjects/app/build/intermediates/res/merged/stage/debug/values-v23/values-v23.xml
这是我的build.gradle
android {
def versionCodeValue = 1
def versionNameValue = "1.0"
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.sample.test"
minSdkVersion 17
targetSdkVersion 22
versionCode versionCodeValue
versionName versionNameValue
}
}
dependencies {
def supportLibVersion = "22.2.1"
compile 'com.android.support:support-v4:' + supportLibVersion
compile 'com.android.support:design:' + supportLibVersion
compile 'com.android.support:appcompat-v7:' + supportLibVersion
compile 'com.android.support:cardview-v7:' + supportLibVersion
compile 'com.android.support:recyclerview-v7:' + supportLibVersion
}
更新支持库后出现此错误。我不想使用目标 SDK 23。我不想在应用程序中使用 RuntimePermission
这是我的 styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorPrimary</item>
<item name="android:windowBackground">@color/colorLightGrey</item>
<item name="android:textViewStyle">@style/myTextViewStyle</item>
<item name="android:buttonStyle">@style/myButtonStyle</item>
<item name="android:editTextStyle">@style/myEditTextStyle</item>
</style>
我不明白为什么它显示错误 values-v23.xml 因为我根本没有使用版本 23。它在
中显示错误/Users/john/AndroidStudioProjects/app/build/intermediates/res/merged/stage/debug/values-v23/values-v23.xml
最佳答案
将您的 Activity 样式更改为旧样式,例如 Theme.AppCompat.Light.DarkActionBar
可能有助于同时将 AppCompatActivity 更改为 Activity。
关于android - 检索项目 : No resource found that matches the given name 'android:Widget.Material.Button.Colored' 的父项时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38355168/