I originally was using compile 'com.android.support:appcompat-v7:19.0.1', and I decided to implement a DrawerLayout. Unfortunately, I was informed that the v4 support library's ActionBarDrawerToggle is deprecated, and to use the v7 version. It appears that this isn't in the 19.0.1 version of support-v7-appcompat, so I decided to upgrade to compile 'com.android.support:appcompat-v7:21.0.0'. Now, however, I'm getting the following error in my styles:
Error:Error retrieving parent for item: No resource found that matches the given name '#style/Widget.AppCompat.Light.Base.ActionBar.TabBar.Inverse'.
(There are a few others).
I've tried a few things, including the following:
Error in styles_base.xml file - android app - No resource found that matches the given name 'android:Widget.Material.ActionButton'
Error retrieving parent for item: No resource found that matches the given name '#android:style/TextAppearance.Holo.Widget.ActionBar.Title'
My build.gradle has the following configuration:
defaultConfig {
minSdkVersion 11
targetSdkVersion 17
}
The v4 support library's ActionBarDrawerToggle was deprecated with the support library v21.
The v7 version was introduced with the appCompat library v21.
Also if you are using the appCompat library v21 you have to compile with API 21+.
Change your build.gradle file:
android {
compileSdkVersion 21
defaultConfig {
minSdkVersion 11
targetSdkVersion 21
}
Related
I'm stuck on compileSdkVersion 25 and targetSdkVersion 25 (not allowed to update), latest Data binding libary requires 26+ and return error if I compile using 25. (path-to-app\app\build\intermediates\data-binding-layout-out\debug\values-v26\values-v26.xmlError:(15, 21) No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.) And chance to downgrade ?
I want to use com.android.future.usb.UsbManager; in my project. This class comes with google api. I created a new project and from the project structure settings ( I use android studio) I changed the compile SDK version to Google APIs (API 19) and the Build tool version to 19.1.0
My build.gradle file is as following, but I get couple of errors.
My question is: How can I find what's the correct combination to use Google APIs (API 19) or Google APIs (API 17)?
Which Build tools version (I tried all in UI)?
Error:(9) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'."
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
compileSdkVersion 'Google Inc.:Google APIs:19'
buildToolsVersion '19.1.0'
defaultConfig {
applicationId "com.example.cihan.myapplication"
minSdkVersion 10
targetSdkVersion 19
versionCode 5
versionName "5.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Edit: I reinstalled Android Studio and selected the latest Google API version and build version (both versions are now 24)
Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'."
You need to compile the appcompat library
dependencies {
compile 'com.android.support:appcompat-v7:19+'
}
Note: I only used version 19+ because that seems to be what you want to compile with. That was released in 2014, so I'd recommend upgrading.
You can compile using the latest SDK and still run (most) your code on devices on API 19
See - Android Material Design | Maintaining Compatibility
I have problems to understand the version scheme of the support libraries and when to use which version. Currently I have a project with compileSdkVersion 21, minSdkVersion 21 and targetSdkVersion 21 and want to use the android design support library.
When I use com.android.support:design:22.2.0 the project compiles but I get a Gradle warning:
"This support library should not use a different version (22) than the `compileSdkVersion` (21)".
When I use com.android.support:design:23.0.1 I get some compilation errors like:
"Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
I thought I can use always the highest version of the support libraries as long as the compileSdkVersion is lower or equal, but that seems wrong.
Can I use the design support library when compiling against API level 21?
Support Library should always match the compileSdkVersion even if the targetSdkVersion or minSdkVersion are lower. If you want to use the design library you will need to set compileSdkVersion to at least 22 and library version 22.2.0.
The reason for that is simple. The version of the library reflects the version of the Android sdk against it was built. If you try to use a higher level version of the support library than the compileSdkVersion it may not find resources that were added in a later version.
You can use one of these:
//You have to use compileSdkVersion=22
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:design:22.2.1'
//You have to use compileSdkVersion=23
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:design:23.0.0'
The design library has dependency with appcompat-v7 library.
You can't use the v23.0.x version compiling with api 22 (it is the reason of "Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Also, because the first version of the design library is 22, you can't use compileSdk=21.
I have set my app's min Sdk version to jelly bean. (created for kit kat)
after that this error occurred.
Android Studio : No resource found that matches the given name: attr 'android:actionModeShareDrawable'
how can I solve this ?
From Error
No resource found that matches the given name: attr 'android:actionModeShareDrawable'
The issue is about compling application with lower target.
AppCompat v21 builds themes that require the new APIs provided in API 21 (Android 5.0). To compile your application with AppCompat, you must also compile against API 21. The recommended setup for compiling/building with API 21 is a compileSdkVersion of 21 and a buildToolsVersion of 21.0.1 (which is the highest at this time - you always want to use the latest build tools).
Make sure the value for target (which tells the target android version) in project.properties file of both your project folder and appcompat_v7 folder is same
: inside 'your_project'/project.properties
target=android-21
android.library.reference.1=../appcompat_v7
and
: inside appcompat_v7/project.properties
target=android-21
android.library=true
and after this don't forget to clean your project .
Hope it helps!
I get many compilation errors when trying to add an ActionBar to my app. Any help is much appreciated!
I recently moved my application development from Eclipse to Android Studio. I'm an absolute novice wrt Android Studio and gradle. I want to add an ActionBar to my app. I want to support devices running at least API level 9. Per the Android developer doc, I see that I've got to use the V7 appcompat library. My SDK manager indicates that both Android Support Repository rev 11 and Android Support Library rev 21.0.3 have been installed. I've also read that my project should use both support-v4 as well as appcompat-v7 - is that right? The gradle file for my app module contains this:
defaultConfig {
applicationId "com.tomoreilly.solarisalpha"
minSdkVersion 9
targetSdkVersion 9
}
[...]
dependencies {
compile project(':androidLVL')
compile 'com.google.android.gms:play-services:+'
compile files('libs/acra-4.2.3.jar')
compile files('libs/htmllexer.jar')
compile "com.android.support:appcompat-v7:21.0.3"
compile 'com.android.support:support-v4:13.0.0'
}
Not sure what version numbers to use for the libraries. I specify appcompat-v7:21.0.3 because SDK manager indicates Android Support Library rev 21.0.3. But what about the version number for support-v4? I just got "13.0.0" from an example on the internet, because support-v4 doesn't seem to show in my SDK manager at all.
When I try to build my project I get many errors like these:
Error:(6, 21) No resource found that matches the given name: attr 'android:actionModeCopyDrawable'.
Error:(5, 21) No resource found that matches the given name: attr 'android:actionModeCutDrawable'.
Error:(7, 21) No resource found that matches the given name: attr 'android:actionModePasteDrawable'.
Error:(8, 21) No resource found that matches the given name: attr 'android:actionModeSelectAllDrawable'.
Error:(9, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Can someone see what I am missing or doing wrong?
Thanks!
Tom
appcompat-v7 automatically includes support-v4, so you can remove that line entirely.
Also make sure your compileSdkVersion in your build.gradle is set to 21 as well as per this question