Android Studio - Appcompat 构建失败 values-v23/styles_bases.xml [英] Android Studio - Appcompat build fail values-v23/styles_bases.xml
问题描述
我将从我想要实现的目标开始:构建此处提供的 googlecast-manager 示例:
我也遇到了同样的问题,现在已经解决了.你所要做的就是
- Android Studio 内部
- 按两次Shift键,会出现一个搜索框,输入build.gradle
- 从建议中选择 build.gradle module:app.
dependencies
下compileSdkVersion
和support libraries
的主要版本应该与下面的代码描述相同.
- Eclipse 内部
找到build.gradle module:app
并执行相同的操作.
注意:下载并正确安装最新的API
,现在是API 23
.
应用插件:'com.android.application'安卓 {compileSdkVersion 23构建工具版本23.0.0"默认配置{applicationId "com.example.inzi.app"minSdk 版本 9目标SDK版本23版本代码 1版本名称1.0"}构建类型{释放 {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'}}}依赖{编译文件树(目录:'libs',包括:['*.jar'])编译'com.android.support:appcompat-v7:23.0.0'}
I'll start from what I want to achieve: building the googlecast-manager example provided here: https://github.com/googlecast/GameManagerSamples I followed instructions here: https://developers.google.com/cast/docs/android_sender
So first I downloaded from github the project, then with the Android SDK Manager I downloaded Android Support Libraries and Google play Services. Then in my project, I went to "Open Modules Setting->Add" then went to "Android SDK\extras\android\support\v7\appcompat" and added it.
Then first step to ensure it's working is to build it. So I right clicked on appcompat->"Compile Module Appcompat" but it fails with 2 errors:
Error:(20, -1) android-apt-compiler: [appcompat] D:\Android SDK\extras\android\support\v7\appcompat\res\values-v23\styles_base.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Error:(19, -1) android-apt-compiler: [appcompat] D:\Android SDK\extras\android\support\v7\appcompat\res\values-v23\styles_base_text.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Doing the same for Google Play works like a charm.
I've tried to find videos/other similar issues but it's either too complicated or not my problem.
Here is the AndroidManifest.xml of appcompat:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.support.v7.appcompat">
<uses-sdk android:minSdkVersion="9"
android:targetSdkVersion="19"/>
<application />
Here is what is installed from the Android SDK Manager:
I also encountered the same problem and now have fixed it. What you just have to do is
- Inside your Android Studio
- press Shift button two times, a search box will appear type build.gradle
- choose build.gradle module:app from the suggestion.
- major version of
compileSdkVersion
andsupport libraries
underdependencies
should be same as following code depict.
- Inside Eclipse
findbuild.gradle module:app
and do the same.
Note: download and install properly the latest API
which is now API 23
.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.example.inzi.app"
minSdkVersion 9
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:23.0.0'
}
这篇关于Android Studio - Appcompat 构建失败 values-v23/styles_bases.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!