简体   繁体   中英

Attempting to create new Android Application with adt tools in Eclipse. R.Java missing, even after clean and rebuid;

Having a problem creating my new android application. I create the new project and I get the error that R cannot be resolved to a variable. I don't import (as I seen not to do on other threads similar to this). I clean and rebuild but R.Java never appears in gen. I've tried a few things but to no avail. Might this be a problem with the version of ADT tools I downloaded or is there something else wrong?

EDIT: This is on windows

Your project fails to generate R file only when your project fails to build. 99% this is due to an error in your XMLs.

Double check your recently changed XMLs for errors.

Check your xml file ,solve the error,Restart project and perform cleaning again. If that doesn't help then follow following steps:-

1. Delete the project.
2. Create New project.

That will resolve the issue

I have just worked through this problem, so I can provide the answer that worked on my system, which is Ubuntu 12.10 64 bit. I found that the following three libraries needed to be installed: libncurses5:i385, libstdc++6:i386, and lib32z1.

The first two libraries are required to run adb. You can test if they are needed by going into /tools or /platform-tools and running adb. If you get an error saying the adb file is not present, but in fact, you can see that it is present, then one part of the problem is that you need these two libraries: libncurses5:i386, and libstdc++6:i386. You can install them with

sudo apt-get install libncurses5:i386 and sudo apt-get install libstdc++6:i386 .

That will get adb working. But I found that this wasn't enough. To automatically generate the R.java file when creating a new project you also need a third library: lib32z1. It can be installed with

sudo apt-get install lib32z1 .

That worked on my system, I've listed the guides that I found helpful in a blogpost . If you're building on a different platform it would be helpful if you would clarify the platform that you are developing on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM