Android .R not generating - checked all common causes - java

After getting a new computer and setting up eclipse again, no projects are generating the .R file. The SDK is on revision 22 which I noticed some people had issues with, but setting the Private Libraries checkbox did not resolve this.
The .R isn't generating for existing projects nor brand new empty android projects. The SDK levels between the build configurations and the manifest match.
An entire uninstall of the SDK, and redownloading the Android version of eclipse and SDK didn't work as well. Could it be something with the versions of Java installed on the machine? Or is there some other common cause of the R not generating I missed after searching?

I got the same error as yours.
note:
The SDK directory architecture of 22.0.1 version is different from before.
there is not platform-tools directory and some command file move to other directory.
but,eclipse and ADT plugin does not update according with SDK
so, linking related bin to platform-tools directory will work.
above meet my error.

Update your SDK Tools from the SDK manager and ADT in eclipse, this was fixed in the latest update (22.0.1)
Also, after you update your SDK, close and reopen the SDK and check for updates again (in case you don't see 22.0.1)
Take a look here for some similar issues Class not found error after updating ADT and Android sdk tools to latest ver 22

Related

Eclipse Android Neon: Tons of errors

I reinstalled 4-5 times the Eclipse Neon (Latest) and I downloaded following SDK's:
SDK Platform API 24 Re. 1
SDK Platform API 8 Rev. 3
Android SDK Tools Rev. 25.1.7
Android SDK Platform-Tools Rev. 24
Android SDK Build-Tools Rev. 24
Android SDK Build-Tools Rev. 23.0.3
Google USB Driver Rev. 11
And I have JDK and JRE 1.8.0 update 92, I use Eclipse Java Neon perfectly errorless.
When I create a project, it looks like this:
And I'm getting following errors:
Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'zzzzf'.
java.lang.NullPointerException
And it cannot resolve variable R.
After editing project properties, I get this message:
[2016-07-10 00:13:12 - zzzzf] Project has no project.properties file! Edit the project properties to set one.
Also I am getting some kind of errors that I dont remember and Eclipse says "Good news! It seems this bug is fixed on next updates. VÄ°sit null for further information." But when I check the updates, there are no update. -- Errors are about running the workbench.
I tried:
Adding resource filters
Editing eclipse.ini by adding this line before -vmargs
-vm /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home
Thanks for your help and giving a part of your valuable time. I am using AIDE for preparing applications and when I switch to PC, I'm busy with problems instead of Java codes...
Problem is solved by switching to Android Studio, because Eclipse is no longer supported by ADT. So that I am getting rid of that errors.
As of Dec 2016, I am able to create, compile and run Android projects under Eclipse Neon.
My installation details are:
ADT Tools 23.0.7.2120684
Eclipse Platform 4.6.1.M20160907-1200 (Eclipse Neon.1)
Ubuntu 16.04
There are some glitches:
LogCat and Devices views don't render well
Previewing a layout is possible, but you have to choose Android version < 23 in the preview version dropdown
If that doesn't work, you can try this independently maintained ADT as well. I get the same result with this ADT, so I didn't bother using it. It seems to be especially useful for those using Android NDK.
Update:
The Eclipse Foundation also maintains a fork of ADT called AndMore. It works fine with Neon.
For converting existing ADT projects to Android-Neon,
just select "configure-->convert From ADT" from the main popup menu.
Also Neon appears to be able to profile your hardware. I was getting crashes until I simply removed the memory and GC entries from eclipse.ini
When a project is created in Eclipse it automatically creates a folder called
.settings
And files named
.classpath,
.project,
project.properties
You can create a new project using the same package name and just copy the files over into this new project, rebuild it.
The more advanced, more direct and less headache approach is to find a current Eclipse project and copy the above named files over and edit them for this project.
Select your android project and go to
Properties => Java Build Path => Libraries => Add library => Android Classpath Contanier => Next => select your project android
Then push button Finish => Apply and Ok! and your errors is empty.
I hope help you... Good luck

Android Lollipop is not listed in Eclipse Target SDK even after installing latest SDK

I am trying to update my Eclipse to Android Lollipop. I am done with downloading the required SDK and installing the same. My problem is that after doing this when I try to create a new project for Android 5.0 it does not list it in the Target SDk drop down. However, When I go to the android folder where I have downloaded the latest SDK and run it it does enlist Android 5.0 there but does not show it when I run SDK Manager from eclipse. I have done lot of troubleshooting like re-installing the whole eclipse again and followed steps given in various same kind of questions but nothing seems working for me.
You have to right click on your project in Eclipse --> Properties --> Android --> Project Build Target and then select Android 5.0.1.
Also you may need to check AndroidManifest.xml for the targetSdkVersion value and target attribute in your project.properties file.
Clean and build your project and you will be fine.

Updating ADT in Eclipse causes many errors

Recently I updated Android SDK Tools, Android SDK Platform-tools, Android SDK Build-tools, and downloaded new APIs Android 4.4W and Android L (both API 20).
After restarting eclipse, it required me to also update the ADT from 22.x that I had to 23.x.
I went to Install New Software in eclipse and updated the ADT to 23.0.4.
After restarting, I figured out nothing in Eclipse is working properly:
All the projects contains errors of several types:
Unable to resolve target 'android-19' until the SDK is loaded.
The type java.lang.Object cannot be resolved.
The project was not build since its build path is incomplete.
The Android SDK Manager won't open.
When I write click on a project -> properties -> Android, there're no libraries and I can't add any.
Never seen something like that. I read that more people had problems after updating the ADT but none of the solutions worked. Thanks
Some hypotheses:
Broken Android SDK + tools installation. -- Can you open the Android SDK Manager and the emulator outside Eclipse? Consider reinstalling the SDK from scratch.
Eclipse can't find the Android SDK + tools installation. -- Check the ADT preferences in Windows > Preferences > Android. See this screen shot.
Broken ADT plug-in or its state. -- Try uninstalling ADT then reinstalling it.
Broken Eclipse installation. -- Consider reinstalling it from scratch. This could be a good time to update to the latest Eclipse (Luna).
Actually, this is a good time to try Android Studio. Right now your relative cost of switching is particularly low. Android Studio will take getting used to but it's slicker, does more work for you, and is the focus of Google's Android tool development. Android Studio is in beta testing but it's stable and usable.
Do watch the video What's new in Android development tools from Google I/O 2014.
See Google's notes on Troubleshooting ADT Installation.
There are more tips for fixing the ADT installation, e.g. Eclipse Indigo Android ADT - install OK, no "Android" option in Preferences and New Project but you can rule out most of those ideas since it used to work for you.
Maybe the fix on this Ubuntu forum post is relevant. There, an Ubuntu upgrade broke ADT because of the needed GEF plugin.
To everyone which gets this problems in the future:
Do not try to struggle with it for hours, with frustrating solutions from the internet.
Simply re-installed eclipse, ADT and android SDK in about 30 mins and everything works perfect, finally.
I am using adt-bundle-windows-x86-20140321, problem occured since updating java.
But now problem already fixed after re-Extracting adt-bundle-windows-x86-20140321.

Android Eclipse - Cannot see annotation processing option

I am unable to fine the option to set annotation processing in my Eclipse preferences.
Not sure since when am I getting this problem but surely it has started to occur after I updated eclipse last.
I also tried pasting the annotations.jar file in tools/support folder but to no good.
Kindly help.
TIA
Installing
Programming Languages > Eclipse Java Development Tools
may enable it again.
It seems Google removed the Annotation Processor option from project properties in the ADT bundle. We are tracking the problem in this AndroidAnnotations issue. The current workaround for this is not installing the bundle, but downloading a standalone Eclipse distribution and adding the ADT plugin to that.
Updating Eclipse Java Development Tools worked for me.
Try This
If annotations.jar is missing, it maybe ADT 23 related problems.
Check this.
Update eclipse with Android Development tools 23
Google response:
...
and copy over the following files:
tools/hprof-conv
tools/support/annotations.jar
tools/proguard
(Added)
If its ADT bundle problem (part of ADT 23 related problem),
this part is for you. (Linked above)
Google response:
...
This is a packaging bug. The entire proguard file is missing. We'll have an update asap, but until then just copy it over from a previous version of the tools:
...
Edit: with the latest ADT release, the bundle should now work with auto-update, so install these new versions:
linux 64 bit vm: http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20140702.zip
linux 32 bit vm: http://dl.google.com/android/adt/adt-bundle-linux-x86-20140702.zip
mac: http://dl.google.com/android/adt/adt-bundle-mac-x86_64-20140702.zip
win32: http://dl.google.com/android/adt/adt-bundle-windows-x86-20140702.zip
win64: http://dl.google.com/android/adt/adt-bundle-windows-x86_64-20140702.zip
Don't try to upgrade from previous version because it doensn't work at all. If you have got problems with zipalign, it's now under platform-tools and no more under tools/ so you can do a symbolic link or just copy it into the expected folder.
or use "not-bundled" Eclipse.
ADT23 problem related links
Issue 72400 (merged into 72419) getDefaultProguardFile no longer returns valid path using build SDK tools 23
Issue 72419 Proguard not installed with SDK tools rev. 23
Copied APTDemo.jar from http://www.eclipse.org/jdt/apt/APTDemo.jar in the lib folder and I can see the option in my compiler preferences. I will investigate later, fixed my problem for now.

IntelliJ IDEA 12 - Incompatible Android version error

I'm starting out Android development with IntelliJ IDEA 12.0.
I have installed and configured JDK and Android SDK. I wanted to target Android SDK 2.3.3 so the SDK is configured as in the screenshot.
When I try and run the project though, I'm getting the following error:
android-validator: [untitled] Incompatible version of Android SDK Platform-tools package. Min version is 11. Please, update it though SDK manager
Followed by
android-validator: [untitled] Incompatible version of Android SDK Tools package. Min version is 19. Please, update it though SDK manager
I wasn't able to find any information on this and not sure what this means. Any pointers is appreciated.
--New project config--
--Install Android Packages--
android-validator: [untitled] Incompatible version of Android SDK
Platform-tools package. Min version is 11. Please, update it though
SDK manager
Because you have revision 10 and the IntelliJ IDEA tool needs revision 11
android-validator: [untitled] Incompatible version of Android SDK
Tools package. Min version is 19. Please, update it though SDK manager
Because you have revision 16 and the IntelliJ IDEA tool needs revision 19
The mentioned minimal revisions are requirements for IntelliJ IDEA to provide Android tools and to compile your applications. You should definitly launch again the Android SDK Manager and check the Tools folder, as on your screenshot, and click on "Install 2 packages".
I had the same issue. I updated "Android SDK Platform-tools" but it didn't work.
After that I realized that in the past I set c:\Android\android-sdk as the SDK folder. But the SDK manager was updating the folder named c:\Documents and Settings\my.user\Local Settings\Application Data\Android\android-sdk So IntelliJ was checking the old folder.
Problem solved after changing to right folder. So be sure that you set new folder if you have such issue. Check help documentation for setting the SDK folders: http://www.jetbrains.com/idea/webhelp/configuring-global-project-and-module-sdks.html

Categories