Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - Appcompat build fail values-v23/styles_bases.xml

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:

  1. 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'.

  2. 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: SDK Manager top SDK Manager bottom

like image 205
Regnoult Avatar asked Aug 19 '15 00:08

Regnoult


2 Answers

I also encountered the same problem and now have fixed it. What you just have to do is

  1. Inside your Android Studio
    1. press Shift button two times, a search box will appear type build.gradle
    2. choose build.gradle module:app from the suggestion.
    3. major version of compileSdkVersion and support libraries under dependencies should be same as following code depict.
  2. Inside Eclipse
    find build.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' } 
like image 122
Inzimam Tariq IT Avatar answered Sep 21 '22 01:09

Inzimam Tariq IT


I believe you should upgrade your compileSdkVersion. Check your build.grade file, should be something like:

android {     compileSdkVersion 23 // <- here     buildToolsVersion "23.0.0" // <- here      defaultConfig {         applicationId "your.id"         minSdkVersion 11         targetSdkVersion 23 // <- and maybe here         versionCode 1         versionName "1.0"     }     buildTypes {         ....     } } 

Of course you will need to download the newest Android SDK and build tools (and whatever else you need) from the SDK Manager.

like image 39
natario Avatar answered Sep 22 '22 01:09

natario