Preface: some time ago, the hard disk was suspended, the new hard disk was changed, the development environment was re-built, jdk was installed normally, the test was OK, eclipse was version 3.8, and adt22 was installed online, the sdk is backed up before the laptop is provided with warranty, and is directly copied and configured to the environment variable. Now the environment is ready for use.
After the environment is well matched, eclipse imports the android project. In my opinion, under normal circumstances (at least the previous project can run normally), the methods on the Internet are similar, and they are usually handled in this way, for example
1. check whether there is an error in the resource file. This situation is guaranteed, because it was previously possible to run normally, and several projects are so large that there are so many resources that it is impossible to open and view them one by one, this is not an efficient method, and eclipse does not prompt which file has an error. In the Problems window, all Errors are R class-not-imported Errors, because no R class is generated;
2. Right-click the Project, and choose Android Tools> Fix Project Properties, clean Project, re-compile multiple times, re-import the Project, and so on. The R class is not generated. This is really a headache and has no headers;
During this period, I opened the Android SDK Manager multiple times and tried to update the ADT. Because there are similar statements on the internet, I can try it. Now, I open it multiple times, and each time I see a problem with slice.
I thought it was because the domestic access was blocked, so the wall and try again a few times, the situation is still the same, Google under the https://dl-ssl.google.com/android/repository/addons_list-2.xml, Read a lot, the English is not good, and the understanding is also vague, but note that the returned content of the above link is related to build-tools, at the same time, we can see that the Android SDK Manager is not installed with build-tools. For example, the red box does not show installation (or even this option is not checked because the above link fails to be accessed)
Check the folder where the sdk is located. This folder is empty. I realized that this may be the cause. I don't know why, back up the previously installed sdk, and why is this folder empty, check the backup sdk and the folder is empty. How can this problem be solved?
Google build-tools accidentally found the download link of sdk build-tools. Try again, decompress it to the build-tools Folder, and restart Android SDK Manager, unexpectedly, the Android SDK Build-tools is displayed as installed, as shown in the figure above. Restart eclipse, clean all projects, and report all errors.
So far, the R file has been automatically generated and the problem has been solved. It is not easy to write a blog post to record the problem solving process.
In addition, provide android sdk build-tools compressed package download link, I have shared to Baidu Network Disk: http://pan.baidu.com/share/link? Upload id = 2683450975 & uk = 52770051. decompress the package to the build-tools Folder.