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 />
The problem generally occurs due to version issues. The following dependencies and compilesdkversion Worked for me:-
Either revert to appcompact-v22 or update to android api v23
If you are working in Eclipse do the following:
AndroidManifest.xml
file changeandroid:targetSdkVersion
to23
ALT
+Enter
while focused in Project Explorer)Android
tab and inProject Build Target
section markAndroid 6.0
NOTE: when you do this have in mind that Android OS would treat your app as if it was designed to work on Android M. So for example if you use some dangerous permissions you should add routines to check then on runtime.
The answer #31 & #11 in this discussion can solve this issue: https://code.google.com/p/android/issues/detail?id=183122
To correct this error in android studio procceded like this : i went to sdk manager and i downloaded and updated all packages of android api 23 file => project structure and i changed compile sdk version from 21 to 23 and build tools version from 21 to 23
I also encountered the same problem and now have fixed it. What you just have to do is
compileSdkVersion
andsupport libraries
underdependencies
should be same as following code depict.find
build.gradle module:app
and do the same.Note: download and install properly the latest
API
which is nowAPI 23
.