Android Library Import delete R - android

I'm making a new android app, and I am using the action bar sherlock library.
I imported the library as a project and got two errors.
First, all my layouts are not found in the gen.R file, because I have no gen.R file.
"R cannot be resolved to a variable"
Second, I read in some forums that a clean and rebuild can help, but this did not fix my problem. After a clean, I got this error:
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:47: error: Error: No resource found that matches the given name: attr 'android:actionBarSize'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:48: error: Error: No resource found that matches the given name: attr 'android:actionBarStyle'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:50: error: Error: No resource found that matches the given name: attr 'android:actionBarTabBarStyle'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:49: error: Error: No resource found that matches the given name: attr 'android:actionBarTabStyle'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:51: error: Error: No resource found that matches the given name: attr 'android:actionBarTabTextStyle'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:52: error: Error: No resource found that matches the given name: attr 'android:actionButtonStyle'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:53: error: Error: No resource found that matches the given name: attr 'android:actionDropDownStyle'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:54: error: Error: No resource found that matches the given name: attr 'android:actionMenuTextAppearance'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:55: error: Error: No resource found that matches the given name: attr 'android:actionMenuTextColor'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:56: error: Error: No resource found that matches the given name: attr 'android:actionModeBackground'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:57: error: Error: No resource found that matches the given name: attr 'android:actionModeCloseButtonStyle'.
...
This XML-Files comes from the ActionBarSherlock Library.
The Library as project didn't show an error.
Can anybody help me?

Make sure that your project and the imported library use the same Android version.
This is often related to the Android version your project uses, specifically if you import something that is a different version than your project.
For a walkthrough to fix the problem, see my answer here

The problem was not the Android Version it was the Java Version. Most of the Android library and also Android too, can not handle Java 1.7. I change my project properties and build my project under java 1.6 and it works. Same problem by HoloEverywhere.

Please note that to compile an android project successfully and to have it run on older version of android is (mostly) a different thing.
for your answer,
android:Theme.Holo is android Honeycomb and above theme. So ActionbarSherlock & your project must be compiled with (minimum) API level 11 (Android 3.0). Usually I just pick ICS (14+)
to have it run on older version of android:
open your project manifest file, change the line:
<uses-sdk android:targetSdkVersion="14"/>
to
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="14"/>
Your android app can run from API level 7 (2.2) to API level 14 (4.0).
You can test by running it with 2.2 emulator.
Note that ActionbarSherlock doesn't run with API level lower than 7.

Related

appcompat dependency error on project

Hi I am trying to build my old project nearly two year old and also i am using eclipse but when i add depedency to my project it shows appcombat v7 jar file missing HERE are screen shot
and in my project properties it shows appcombat..../bin appcombat v7.jar file is missing so i copied jar file from sdk and paste it after that my project which shows ! now shows error * also appcombat is showing error please help me guys here is screen shot of that
In appcombat under resource->values-v21->style_base->
<style name="Base.Widget.AppCompat.ActionButton"
parent="android:Widget.Material.ActionButton">
</style>
it shows error Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
error log is:
[2015-09-08 11:38:37 - Raftaar_Jyotish] D:\Gaurav\Work\v7\appcompat\res\values-v21\themes_base.xml:137: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
[2015-09-08 11:38:37 - Raftaar_Jyotish]
[2015-09-08 11:38:37 - Raftaar_Jyotish] D:\Gaurav\Work\v7\appcompat\res\values-v21\themes_base.xml:134: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
[2015-09-08 11:38:37 - Raftaar_Jyotish]
[2015-09-08 11:38:37 - Raftaar_Jyotish] D:\Gaurav\Work\v7\appcompat\res\values-v21\themes_base.xml:135: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
[2015-09-08 11:38:37 - Raftaar_Jyotish]
[2015-09-08 11:38:37 - Raftaar_Jyotish] D:\Gaurav\Work\v7\appcompat\res\values-v21\themes_base.xml:144: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
[2015-09-08 11:38:37 - Raftaar_Jyotish]
[2015-09-08 11:38:37 - Raftaar_Jyotish] D:\Gaurav\Work\v7\appcompat\res\values-v21\themes_base.xml:148: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
[2015-09-08 11:38:37 - Raftaar_Jyotish] ............
many times
You should import Appcompat as a project, then in properties > android set it to a library (check islibrary), and don't forget to set the appropriate project build target.
After that go to your project and from properties > android add that project as a library

I got past "aidl missing' in android studios and now have 7 new errors

I used to have the aidle missing error then I started using ice cream sandwhich api and build tool 1.9.1.0 which I got 7 errors similar to the ones I list (copied and pasted). I don't know what is wrong i'm using ubuntu 14.04 and am using android studio. I have done and researched everything I can.
Error:(6, 21) No resource found that matches the given name: attr 'android:textAlignment'.
Error:(10, 21) No resource found that matches the given name: attr 'android:paddingEnd'.
Error:(10, 21) No resource found that matches the given name: attr 'android:paddingEnd'.
Error:(13, 21) No resource found that matches the given name: attr 'android:paddingStart'.
Error:(17, 21) No resource found that matches the given name: attr 'android:layout_marginEnd'.
Error:(10, 21) No resource found that matches the given name: attr 'android:paddingEnd'.
Any leads at all will help.
android:textAlignment was add in android 4.2
try android:gravity
and the same for the rest
check this for more information http://developer.android.com/about/versions/android-4.2.html

Android appcompat-v7 themes_base.xml No resource found error

I have been trying to import appcompat-v7 into my app and have had no luck at all. I need this library in order to follow the steps listed here How do I use DrawerLayout to display over the ActionBar/Toolbar and under the status bar?. I have followed the steps documented https://developer.android.com/tools/support-library/setup.html, and when I add the library to my project, I'm getting a list of errors:
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:136: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:140: error: Error: No resource found that matches the given name: attr 'android:colorButtonNormal'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:138: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:139: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:137: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:134: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:135: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:144: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:148: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
I have the build target to API 21 for android-support-v7-appcompat. When I clean that project, I don't receive any errors. When I add appcompat-v7 as a library to my project, that is where the errors start appearing.
I have checked my SDK manager and everything is up to date. Can anyone help steer me in the right direction where I can resolve this issue?

Appcompat v7 and ActionBarActivity

I'm following this tutorial to make and app with action bar for 2.3.x devices. But i cannot import appcompat-v7 to my projecto... It gives me lots of errors like these:
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:194: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:195: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:193: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:190: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:191: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-large-v14\themes_base.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Base.AppCompat.DialogWhenLarge.Base'.
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-large-v14\themes_base.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Base.AppCompat.Light.DialogWhenLarge.Base'.
So i cannot import my app theme and my action bar is not shown...
In project.properties for Your project android-support-v7-appcompat Make sure target value as follow.
Project target.
target=android-21
android.library=true
once you done Clean your Project. I hope this works.
In project.properties of both your project and android-support-v7-appcompat (under res), comment out the target api if not target=android-21 and place the new target code there.
If this doesn't work, or you can't use 21+ api, make sure in your app's project.properties that android.library=false.
Next check your project's Referenced Libraries does not contain v4 in the buildpath. I believe I'm saying this correctly, that v7-appcompat required it (the previous version), but that it is included within the android-support-v7-appcompat file and thus the duplicate entries cause a problem.
I got this problem too. I found many solutions that you must update to Android 5.0 API leveL 21..you can see one of the solutions for updating all IDE. HERE
..
(Note : Following method is my second way solution for me.)
If you don't want to update, you can try existing API level..I found solution in my way is that when you create the new android application project, choose as follow
minSdkVersion= API 14 ,
targetSdkVersion=API 17 ,
compiled with=API 17
Hope, this will help!

Error importing Holo everywhere theme

I have followed the the guides on few sites and I cannot get it to work. I made sure they I created the project from existing source, and include as libraries in my project, checked targets, etc. I'm not sure what I'm missing.
I get the following errors:
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values\styles.xml:246: error: Error: No resource found that matches the given name: attr 'windowActionBar'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values\styles.xml:247: error: Error: No resource found that matches the given name: attr 'windowNoTitle'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:12: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:14: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:16: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light.DarkActionBar'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:18: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.ForceOverflow'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light.ForceOverflow'.
[2012-08-29 21:46:56 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values\styles.xml:247: error: Error retrieving parent for item: No resource found that matches the given name '#style/Theme.HoloEverywhereDark.Sherlock'.
[2012-08-29 21:46:56 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values\styles.xml:253: error: Error retrieving parent for item: No resource found that matches the given name '#style/Theme.HoloEverywhereLight.Sherlock'.
Guides Followed:
Error importing HoloEverywhere
https://github.com/ChristopheVersieux/HoloEverywhere
The HoloEverywhere guide you linked to is a small bit out-of-date, the two themes are now called Holo.Theme and Holo.Theme.Light.
So change these lines in your Android manifest:
android:theme="#style/Theme.HoloEverywhereDark.Sherlock"
or
android:theme="#style/Theme.HoloEverywhereLight.Sherlock"
to
android:theme="#style/Holo.Theme"
or
android:theme="#style/Holo.Theme.Light"
Then Project->Clean and see if the errors disappear.
As you are using Sherlock theme(Not integrated Android Theme) you need to import that additional package under ProjectName/ folder
+ProjectName
src
gen
Android2.1
Sherlock.jar(Import tht .jar file under root Folder)
bin
. . .
I solved the problem by setting the android target of all the projects to the newest android version (v.17 atm)

Categories

Resources