I had R.java file in my android application. But I don\'t know, It is delete some how. To create it again I clean my project and also Rebuild my project by clicking on Build
Try this:
R.java
class ctrl+space
. Eclipse will try to codehint you, automatically importing the correct R.java
.If you are facing this problem after updating ADT, you should install that Android Build Tools . In my case installing Build Tools and restarting eclipse solved this problem.
Some quick solutions to your problem might be,
R.java
class that is automatically generated when you build.R
is a generated class. If you are using the Android Development Tools (ADT) it is generated whenever the project is built. You may have 'Build Automatically' turned off. Turn it on and build your project.import android.R;
You can create R.java file using aapt tool by executing following command.
ANDROID_HOME/platform-tools/aapt
package
-v
-f
-m
-S DEV_HOME/res
-J DEV_HOME/src
-M DEV_HOME/AndroidManifest.xml
-I ANDROID_HOME/platforms/android-7/android.jar
Generate Resource java code and packaged Resources
aapt package -f -M ${manifest.file} -F ${packaged.resource.file} -I ${path.to.android-jar.library} -S ${android-resource-directory} [-m -J ${folder.to.output.the.R.java}]
You can find more detail about options on this link
http://www.herongyang.com/Android/Project-aapt-Android-Asset-Packaging-Tool.html
yeah,maybe there are some error in your layou or drawable dir. see the [problems tag] to get more detail