Here are some of the more common solutions, the details are as follows:
1. Sometimes eclipse does not compile automatically, clean project and let R.java regenerate
2. Select Menu Project >> Clean, provided that the Bulid automatically (automatically build deployment) is checked, and the project is rebuilt after clean, because in general, The R.java file will update the build side at this time, and if the project is wrong, it will not be generated automatically.
3. Select Engineering, right-click Android Tools >> fix Project Properties This operation can sometimes fix some errors.
4. The previous version of the 1.5/1.6/2.1 SDK Layout_height did not see match_parent this attribute, android:layout_height= "Match_parent" This attribute will result in XML not being compiled and cannot be generated R.java
This is an advanced version of the downgrade may occur, the solution is to replace match_parent with Fill_parent
When you import other source code, first of all to ensure that the source of the SDK version and your eclipse default version is consistent.
5. When there are other XML and class errors in the project, they are not compiled automatically, and the jar bundle reference is not automatically compiled when there are errors.
Also attached:
View the source version of the method: Open the Default.properties file, see target=android-7 After this number is how much.
Version correspondence: Target=android-3 <---> Android 1.5, target=android-4 <---> Android 1.6,
Target=android-7 <---> Android 2.1, target=android-8 <---> Android 2.2, target=android-10 <---> Android 2.3.3,
TARGET=ANDROID-14 <---> Android 4.0, target=android-15 <---> Android 4.0.3, target=android-16 <---> Android 4.1, TARGET=ANDROID-17 <---> Android 4.2 other tests.
The above introduces the eclipse to write Java program will not automatically generate R.java files and packages of solutions, I hope this article to share can help everyone.