Problems and problems that are easy to encounter when setting up the android Development Environment
1. JDK is backward compatible. JDK has a higher version, and eclipse, ADT, and SDK can have a lower version.
2. The eclipse version must match the ADT and SDK versions. Whether it is an earlier version of eclipse that installs a later version of ADT or a later version of eclipse that installs an earlier version of ADT, conflict may occur during the installation process and thus cannot be installed, even if the installation process passes successfully, the installation is unsuccessful, because after eclipse is enabled, there is no set of function buttons that should appear after AVD is successfully installed on the eclipse interface,
The mark of AVD installation success when these buttons are used.
3. If the corresponding version of ADT is installed in eclipse. If it does not match the SDK version, the android platform version cannot be found when eclipse creates an android project.
Build target is empty. Open eclipse --> window --> preference --> Android
In the red box, a line of English with a Red Cross icon on the top will appear, which means that the SDK of this version requires the lowest version of ADT to be V *.*. And it is empty in the list below, without any SDK information. You must find the corresponding SDK to solve this problem. In addition, after the SDK of the corresponding version is installed and downloaded, you must enter the directory where the SDK is located in the SDK Location to display the version information in the SDK.
4. if you want to add the new SDK information to the directory, you can download the latest android platform version (the android platform version naming rule is android -*, for example, android-8, android-10, and android-18), decompress the downloaded latest android platform file and place it in the platforms folder under the android SDK directory. Restart eclipse to create a new project. The new android platform information is displayed in the list and can be selected.
5. The naming rules for the source files of android are android-*. *-src. Src is the abbreviation of source. Like android-2.2-src. Do not confuse the android source file with the android platform. The android source file is used to associate the source code of the classes in the android library in the Code with the class names of these classes in the code. This allows us to access the source code of these classes in our own code. Place the cursor over the class name, and press ctrl to click the left mouse button. Such as activity. These codes should be placed in the source folder of the platform corresponding to the version. For example, the platform for android-2.2-src is android-8. Therefore, after we get the android-2.2-src file, first decompress and find, android SDK directory, and then find the platforms folder, and then find the android-8 folder, enter the folder and copy the unzipped folder of the android-2.2-src to it and rename it source. Then you can associate it in eclipse. The association method is as follows: Take Activity as an example. Find the Activity in the code. Press ctrl + the left mouse button to click. In the new pop-up interface, the source file cannot be found and an Attach button appears below. Click the button, and then fill in the corresponding column in the above source folder according to the steps. After the operation is complete, the system will automatically refresh and the source code of the Activity class will appear on the page.
6. When configuring environment variables, You need to configure two (I use eclipse3.5 and android SDK2.3. It is not clear whether two variables need to be configured in the new version.) The environment variable ANDROID_SDK_HOME cannot be renamed. The content must only be the path of the android SDK. The two environment variables android_sdk \ platforms and android_sdk \ platformstool can be placed in another environment variable, which can be called Android or other. If the first environment variable ANDROID_SDK_HOME is set incorrectly, the AVD cannot run. When running AVD, the following error message is displayed:
In addition, in android --> bulid under eclipse-window-preference, we can see that the Defult debug keystore is C: \ users \ Administrator (under win7 X64. In other versions of windows, this directory is different.) This directory is not in the android_SDK directory. AVD information cannot be found for all avd_managers. After setting the ANDROID_SDK_HOME environment variable, restart eclipse to view the column again. The value will be changed to the directory where android_SDK you set in the environment variable value. Start AVD again to run smoothly. If the value of this topic does not change, the ANDROID_SDK_HOME environment variable is not correctly set and must be reset.