Cannot build actionbarsherlock: BuildConfig cannot be resolved to a variable - android

I imported the actionbarsherlock folder into the workspace using "Import -> Existing Android Code Into Workspace". Then I ensured the following:
In the manifest:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="16"/>
Properties -> Android: Build target is API 16 (Android 4.1.2) and IsLibrary is checked.
Properties -> Java Compiler: Compiler compliance level is set to 1.6.
And yet I'm getting a lot of BuildConfig cannot be resolved to a variable errors.
I tried to clean all projects many times, and even restarted Eclipse several times. I even tried to add a BuildConfig class manually, but then there were still a lot of R cannot be resolved to a variable errors that I could not resolve.
I've read dozens of answers (such as this one: R cannot be resolved error when using ActionBarSherlock ), but nothing helps. Any help will be much appreciated.

Strangely enough, the problem was that I skipped MIPS System Image the last time I updated components in the Android SDK Manager. Now I updated MIPS System Image from revision 2 to 4, and everything builds fine.
I don't even use MIPS, but maybe there was some strange compatibility issue.

I had the same problem. When I went back to the Android SDK Manager it showed me that I could update Android SDK Platform-tools and Android SDK Build-tools to version 17. That fixed the problem for me.

Strangely enough, this issue gets fixed when I add old flavors of Android SDK build tools: 18.x and 17.x
(For some reason, I uninstalled some of those)

Related

Android SDK for eclipse using Google Play Services Lib: Error "Target runtime jre1.8.0_25 is not defined."

For university, I am working on an android-project, which uses the "Google Play Services Lib".
However, my eclipse throws an error, stating, that the "Target runtime jre1.8.0_25 is not defined.".
This being a git project, I have not installed/configured the library myself, though for others it seems to work flawlessly.
Being not very well versed with eclipse, I have tried to check every reference to the aforementioned jre in the projects settings, though I was out of luck, a quick fix isn't available either.
This error occurs to you because developing android does not support JDK 1.8
To solve this problem you need to install JDK 1.7(you might need to uninstall JDK 1.8, but it is for sure that you need JDK 1.7). This will solve your problem.
The last check you need to do is Project > Properties > Java Compiler(here you have to select 1.7 or 1.6)

The styles.xml file is not generated in my android project

Recently I updated my eclipse Juno to Luna, but now the new project don't generate the android.R file. This probably caused by this AndroidManifest.xml error:
Error: No resource found that matches the given name (at 'theme' with value '#styles/AppTheme').
When I check the values folder, there is no styles.xml.
This only happens with the new projects, the existing projects (which I created in Juno) work fine.
I've tried updating everything in SDK manager, but I still get the error.
I don't know the specifics, but I just fixed this on both my Linux machine and Windows machine. It stops producing the style.xml after you upgrade your Android SDK Tools to revision 24 or higher.
I fixed mine by downgrading as seen at this other SO discussion using the version 23.0.5 (I'd post direct links, but I don't have enough points here to post more than two).
Again, I have no idea WHY this is happening, only that it prevents me from creating new projects with the latest SDK.
I met the same problem when I updated my Android SDK Tools. When I build a new Android project, it doesn't generate the styles.xml in res/values/. But after I builded a new styles.xml and copied content from other project, the problem disappeared.
The error has been corrected in Android SDK Tools 24.0.2. I just test it now.
If it happened during your first Andriod App build, it must be just like my case.
It happened to me when Eclipse(Luna)/AndroidSDK(not Android Stduio) were used with the latest tools and library as of Jan. 14, 2015 during the project like HelloWorld. When I installed those tools and made HelloWorld the first app, I accepted all the defaults. - This is the problem in my case.
First, check whether or not the "Android Support Library" library is installed.
If not, install it. It is not installed by default.
You may do it all in "Android SDK manager" available in the menu.
(Android SDK Manager -> Extra -> Android Support Library)
Blessings,
(a debtor)<><

container 'Android Dependencies' references non existing library '/workspace/appcompat_v7/bin/appcompat_v7.jar

First of all, i know this question has been asked a lot, but nothing seem to be working for me.I have installed Eclipse ADT On MAC 10.9.5 from android.developer.com and have installed latest Android SDK tools, and all other platform and tools required for Android 5.0, android 4.4W and Android 4.4.2. I have also installed Android support library. But when i try to run the project with the default properties,
http://postimg.org/image/4lf8ayl99/
Minimum Required : SDK-API8:Android 2.2(Froyo)
Target SDk-Android; 4.x(L Preview)
Compile With ; API 21: Android 4.x( L Preview)
It always give me error,
The container 'Android Dependencies' references non existing library '/Users/xxx/Documents/workspace/appcompat_v7/bin/appcompat_v7.jar'
I went through all the solutions listed on web and on this website too, but nothing worked for me.
appcompat_v7 library gets generated, and then i click on add to build path for android-support-v7-appcompat.jar and android-support-v4.jar, and then from build path add the two libraries and untick android dependencies and add the library to my project from android library. From other posts i get to know that after clean and build appcompat_v7 library project , appcompat_v7.jar would be generated in bin directory, but it doesn't happen in my case.
Please help. I have spent too much time looking for the solution, but didn't find any.
I finally found the solution, I had to update the jdk to 1.8, The jdk installed by default by eclipse ADT form android.developer.com doesn't seem to be updated and Since API 21 requires jdk 1.7 or above thus i had to install it from JDK official website http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html. Finally i got the support library appcompat_v7 working.
I had the same problem and I tried and after that message I got another from the res folder. Anyways what I did was switch work space and it worked fine . it should create those files for you as long as you downloaded the extras from android manager downloader.

R file not generated

I know many similar questions have been asked for example this one. Mine is slightly different. I create a new android project using all the default settings (target SDK 4.2 Jelly Bean, min SDK 2.2 Froyo). The project is created without an R file. I tried cleaning the project and nothing happens. I tried looking for errors in the res folder and nothing happened. All my XML file names are lower case. What could I have messed up to cause brand new projects to not generate R files? Is there some Eclipse configuration that needs fixing? Is there some Android module that I haven't installed? Any help would be greatly appreciated.
make sure you have android sdk build tools installed from the sdk manager if you have updated adt to rev 22
Install it resart the eclipse and make clean and rebuild project it will work

Error when opening previous android project in Eclipse

I need to open a previousely developed android application in Eclipse. The application has developper for the Android 1.6 target. When I import the project to the eclipse IDE it gives the following error.
Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
After that:Right click the the Project -> Android tools -> Fix project properties
Still I can't open the project. Does any one have experience this before or have any idea to get rid of this error.
Thans inadvance.
For Android you should use JDK 1.5 (5.0) or 1.6 (6.0). In your case you use JDK 1.7, and Android throws error about this.
First make sure that android 1.6 must be installed on your machine. Secondly java compiler 5.0 or 6.0 must be there if you not have download and installed.
So Set the appropriate java compiler for compilence.
For doing it--> Right click on project->properties->java compiler.
you can also change build target for the project by--> Right click on project->properties->Android
I think you have entered a wrong Java version, you asked for 1.7 (which is not Java 7 as some are referring) when it requires at least Java 5.
So try to change the version from 1.7 to 7 or to the one you have.
This is done in the manifest file I think

Categories

Resources