R. JAVA is not automatically generated for the new Android project. You should upgrade the ADT first.

Source: Internet
Author: User

A few days ago, I was very depressed. I planned to create a small item on Android. I turned on Eclipse to create a new project and found that there was no R. JAVA!

The test was repeated many times but failed. Finally, I tried to upgrade the ADT and the result was done. Here I will write down the result. For details about the problem, refer.

In addition, you can try other online solutions!

1. Select Project> Clean to check Bulid Automatically (Automatic Build and deployment). After you click Clean, the Project will be rebuilt. at this time, the java file will be updated and generated again. If there is a wrong project, it will not be generated automatically. 2. Select a Project and right-click Android Tools> Fix Project Properties. Sometimes some errors can be corrected, but I cannot. 3. Another argument is to re-create an empty project, copy the code and resource files in the project according to the corresponding package path, and then generate a new one, I also think that the first method is to re-build the heat, and the Nature is the same.
The above methods have been tried, and R. java still does not appear, and the entire project is still a lot of errors. Click a layout XML file with an error. The error code android: layout_height = "match_parent" is displayed ", previously, I used SDK layout_height In SDK 1.5, 1.6, and 2.1 without seeing the match_parent attribute. Then I asked a group of brothers to say that this attribute is 2. if you think about Version X, is it because of the problem of the SDK version of the project and the default SDK version of eclipse? select the project, right-click Properties> Android, and then you will see a Target Name on the right, I selected Android 1.5, and then changed it to 2.1. Click Appply to automatically build the project. I saw fewer errors, changed to 2.2, and rebuilt the project. The error was gone, the unsolved problem is solved, R. java is also coming out. I'm so happy that everything is normal to start the simulator.
In summary, when importing other source code, make sure that the SDK version of the source code is consistent with the default version of your eclipse. View the source code version: Open the default. properties file and check the number after target = android-7. Version ing: target = android-3 <---> android 1.5, target = android-4 <---> android 1.6, target = android-7 <---> android 2.1, target = android-8 <---> android 2.2.

R. java is missing in the automatically generated project,

 

Choose "right-click your Project"> "Android Tools"> "Fix Project Properties" on the Internet,

Make sure that the project has been compiled clean, or right-click the project --> property --> android --> applay.

After the communication between google and Baidu, there was no result.

The handler program seems to have been corrupted and cannot be executed. Therefore, it is executed in sdk setup to obtain the file and overwrite the original one. R. java is automatically generated.

Why is aapt.exe damaged?

Http://www.cnblogs.com/cngreatwall/archive/2011/03/11/1980525.html

I'm a split line -----------------------------------------------------------------------

 

I cannot generate r files, but it is different from what I mentioned above.

1. AndroidManifest. xml

<Activity android: name = ". Index" android: label = "@ string/index"> </activity>

Index not defined!

2. The package name has been changed. The package name in AndroidManifest. xml has not been changed yet.

3. The resource file can only start with lowercase letters and underscores, and only a-z, 0-9, and _ can appear in subsequent names.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.