I'm Practically a first timer so forgive me if my question sounds too easy for you.
I made a new android project in Eclipse with lower APIs (8 and 10) but I keep getting an error in styles.xml in values and also the R.java file is not created (which is because of the style problem. as I've learned, it gets generated with project->clean after the styles problem is fixed.)
but later on I made a new project with a higher API (4.0.3) at it's all good and everything is generated the way it should.
now I did my research in the following 3 questions here:
Eclipse Errors: styles.xml no resource, java.io.FileNotFoundException, and also R.java not regenerating
Android .R not generating - checked all common causes
R. java file is not generated. How to fix it?
but none mention the problem being related to lower APIs.
thanks in advance for any help you can provide.
This is the line of the error:
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
and in console I get this error:
[2016-06-20 19:05:11 - AndroidApp] D:\Utilities\eclipse\Workspace \AndroidApp\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2016-06-20 19:05:11 - AndroidApp] D:\Utilities\eclipse\Workspace\AndroidApp\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2016-06-20 19:05:11 - AndroidApp] D:\Utilities\eclipse\Workspace\AndroidApp\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
Related
hi i am a beginner for android i was decompile an app and i det the code source but when i import it on eclipse its give me this error:
error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'.
i try some tips that i found it in stack-overflow but not working
if you know the solution help me
This may caused you haven't installed API > 21 in your computer (http://android-developers.blogspot.com/2014/10/appcompat-v21-material-design-for-pre.html).
Open SDK Manager and install it.
And another important thing i want to talk about is why you use Eclipse instead of Android Studio? eclipse is now no longer supported by Google
I am a new in Android Development and I am having some issue about the R.java file. And I read some suggestions that in order to generate this file you shouldn't have any error on the XML file. In my case I fave an error in my styles.xml
error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
And also this:
ActionBarActivity cannot be resolved to a type
And I read this solution that I need to reference the AppCompat but when I checked on my settings the AppCompat has an error.
I already updated my SDK tools with the latest one
And also can you help me how can I solve the problem in the R.java. What I know is it is auto generated but in my case it doesn't generate even I start a new project.
Can you help me with this? So that I can continue my study. Thanks.
Hello I am trying to use the them "Theme.Material.Light.DarkActionBar"
I updated my SDK and ADT, I have the latest lollipop phone. I am compiling it with android 5.1.
I changed manifest to
android:minSdkVersion="22"
android:targetSdkVersion="22"
Inside of my manifest I put:
android:theme="#style/Theme.Material.Light.DarkActionBar"
However I get the error saying Error:
No resource found that matches the given name (at 'theme' with value '#style/Theme.Material.Light.DarkActionBar') .
How can i fix this so I can use this theme in my app please. ps I am using Eclipse.
You should change:
android:theme="#style/Theme.Material.Light.DarkActionBar"
To
android:theme="#android:style/Theme.Material.Light.DarkActionBar"
Because it is an Android resource and not your project's resource.
As referenced in https://developer.android.com/training/material/theme.html
you should try -
#android:style/Theme.Material.Light
I know many others have experienced a similar issue and I found these questions that were very similar to my issue:
Android Support Library v7: Error retrieving parent for item
error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ActionButton'
The problem is that I tried the different solutions offered in those answers such as changing the target sdk to something like 14 or 15, and also cleaning and rebuilding the project. I am using intelij and I havent been able to make the following errors disappear:
Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ActionButton'
Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Light.ActionButton'
are there any other things that I can try to attempt to correct these errors? any suggestions are appreciated
Maybe you are not including the support library to your project.
Also have a look at this question Use AppCompat Library for ActionBar support
Add the support library from your adt location like this :
adt-bundle-windows-x86_64-20130917\sdk\extras\android\support\v7\appcompat\libs\android-support-v7-appcompat
to your project and clean the project..It should fix it.
You should ask yourself the following question "Do I want to support older (<4) android versions?"
If you don't want to, you don't have to use AppCompat. If you do want to support older versions, you simply include the Appcombat library.
Right click on your Hierarchy and select import. Browse to the location of your SDK/Extras/Android/Support/V7/Appcompat/ and import that library.
Now mark the project as a library and add the Library to your app. Now, Appcompat can actually be resolved.
I tried to compile a project with target SDK 13, and then i got few errors about resources. I got few same errors, and one of them is:
android-apt-compiler: [android-master5] C:\Documents and Settings\...\Local Settings\Application Data\Android\android-studio\sdk\android-master5\res\values\styles.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'style/Theme.Sherlock.Light.DarkActionBar'.
What should I do ?
Sorry for bad english.
In the file styles.xml that is mentioned in the error, if line 24 literally says:
'style/Theme.Sherlock.Light.DarkActionBar'
then change it to:
'#style/Theme.Sherlock.Light.DarkActionBar'
(You just missed the # symbol)
I found this post while searching for a similar error message that I got when migrating from eclipse to Android Studio. In my case the very same theme was not found for AndroidManifest.xml:
My Problem was solved by adding
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
compile 'com.android.support:support-v4:18.0.+'
to the dependencies in the gradle file as suggested here:
https://github.com/JakeWharton/ActionBarSherlock-Gradle-Sample
Speaking of, it seems AppCompat is the new thing for backwards compatible ActionBars...