Here are some of the more common solutions.The details are as follows:
1. Sometimes eclipse does not compile automatically,Clean the project and regenerate r.java
2. Select the menu project>clean, as long as bulid automatically is checked, the project will be rebuilt after clicking clean.Because in general,The r.java file will be updated and generated at this time.If the project is wrong,It will not be generated automatically.
3. Select the project,Right-click android tools>fix project properties This operation can sometimes fix some errors.
4.I don't see the match_parent attribute in the SDK layout_height of the old version 1.5/1.6/2.1.android:layout_height="match_parent" This attribute will cause xml not to compile and cannot generate r.java
This is what may happen after downgrading the advanced version.The solution is to replace match_parent with fill_parent
When importing other source code,First make sure that the SDK version of the source code is consistent with your eclipse default version.
5. The project will not automatically compile when there are other xml and class errors.If the jar package is referenced incorrectly, it will not be compiled automatically.
To view the source code version:Open the default.properties file and see what the number is after target=android-7.
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 self-testing.
The above introduces the solution for writing java programs under eclipse that does not automatically generate r.java files and packages.Hope this article can help everyone.
- python 3x - typeerror: 'method' object is not subscriptable
- python - you may need to restart the kernel to use updated packages error
- xcode - pod install [!] no `podfile 'found in the project directory
- android studio - unresolved reference comes out in kotlin
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- android studio - emulator: dsound: could not initialize about the error message directsoundcapture
- django - oserror: [winerror 123] the file name, directory name, or volume label syntax is incorrect : '<frozen importlib_boot
- mysql startup failed [error] innodb: the innodb_system data file 'ibdata1' must be writable
- python - importerror: cannot import name md5 error cannot be resolved