使用Android Studio上较旧的targetVersion在项目构建中将TargetSdkVersion更新为23时,在构建时出现以下错误。
/path/to/project/app/build/intermediates/res/merged/debug/values/values.xml
Error:(1334) Error retrieving parent for item: No resource found that matches the given name '@style/TextAppearance.AppCompat.Light.Base.SearchResult.Subtitle'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/path/to/AndroidSdk/build-tools/23.0.1/aapt'' finished with non-zero exit value 1
build.gradle是
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.myapplicaitonid"
minSdkVersion 15
targetSdkVersion 23
versionCode 8
versionName "1.0.7"
}
buildTypes {
release {
minifyEnabled false;
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "com.android.support:appcompat-v7:23.1.1"
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.squareup.picasso:picasso:2.4.0'
}
尝试:https://stackoverflow.com/a/27243716/4221298
但仍然是同样的问题。
任何人都面临类似问题并解决了吗?
最佳答案
得到它了
此主题已弃用。
阅读TextAppearance.AppCompat.Light.SearchResult.Subtitle
错误:(1144)检索项目的父项时出错:找不到资源
匹配给定名称
'@ style / TextAppearance.AppCompat.Light.Base.SearchResult.Subtitle'。
<style name="TextAppearance.AppCompat.Light.SearchResult.Subtitle"
parent="TextAppearance.AppCompat.Light.Base.SearchResult.Subtitle">
</style>
随着Android随每个新版本的发展而变化,某些行为甚至外观可能会发生变化。但是,如果平台的API级别高于应用程序的targetSdkVersion声明的版本,则系统可能会启用兼容性行为,以确保您的应用程序按预期方式继续运行。
由于弃用,您无法拨打电话。
TextAppearance.AppCompat.Light.Base.SearchResult.Subtitle
从API 23中弃用。
关于android - TargetSdkVersion上的Android Studio“检索父项时出错,找不到与给定名称匹配的资源”更新为23,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35034266/