当我在 android studio 中开始新项目时,我收到了这些错误。
错误:(1) 检索项目的父项时出错:找不到与给定名称“android:TextAppearance.Material.Widget.Button.Borderless.Colored”匹配的资源。
错误:(1) 检索项目的父项时出错:找不到与给定名称“android:TextAppearance.Material.Widget.Button.Borderless.Colored”匹配的资源。
错误:任务“:app:processDebugResources”执行失败。 com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.2\aapt .exe” 以非零退出值 1 结束
android项目中的文件包含错误如下:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Base.TextAppearance.AppCompat.Widget.Button.Borderless.Colored" parent="android:TextAppearance.Material.Widget.Button.Borderless.Colored"/>
<style name="Base.TextAppearance.AppCompat.Widget.Button.Colored" parent="android:TextAppearance.Material.Widget.Button.Colored"/>
<style name="TextAppearance.AppCompat.Notification.Info.Media"/>
<style name="TextAppearance.AppCompat.Notification.Media"/>
<style name="TextAppearance.AppCompat.Notification.Time.Media"/>
<style name="TextAppearance.AppCompat.Notification.Title.Media"/>
</resources>
构建.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.anmol.checkboxapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.1.0'
}
如果有人有这个问题的解决方案,请帮忙
原文由 Anmol Nijhawan 发布,翻译遵循 CC BY-SA 4.0 许可协议
您编译的 SDK 版本必须与支持库匹配。执行以下操作 之一:
1.在你的
Build.gradle
改变2.或改变:
至
当您使用时:
compile 'com.android.support:appcompat-v7:25.3.1'
我建议使用第二种方法,因为它使用的是最新的 sdk - 这样您就可以利用最新的 sdk 的新功能。
带有构建工具 27.0.2 的 build.gradle 的 最新示例—— 源
如果您在更新版本时遇到问题,例如:
通过此 答案 使用 Google Maven 存储库 轻松升级
编辑
如果您使用 Facebook 帐户工具包
不要使用:
compile 'com.facebook.android:account-kit-sdk:4.+'
而是使用特定版本,例如:
使用 sdk 23 的帐户工具包中的最新版本存在问题
编辑
对于 Facebook 安卓 SDK
在您的
build.gradle
中,而不是:使用特定版本:
Facebook sdk 中的最新版本与 Android sdk 版本 23 存在问题。