When I made my android app and ran it for the first time then the R.java file wasn't automatically generated. Then, I first cleaned the project and later on autobuild it and the R.java file was regenerated. But now I am getting error on
setContentView(R.layout.main);//main can't be resolved or is not a field.
So, how to overcome this error else tell a better way to autogenerate the R.java file?
try out these things
if you have this in your imports:
remove it and then add
and clean and build the project
go through the documentation for details
*Note: Eclipse sometimes likes to add an "import android.R" statement at the top of your files that use resources, especially when you ask Eclipse to sort or otherwise manage imports. This will cause your make to break. Look out for these erroneous import statements and delete them.*