When Ecplise + ATD + Android SDK is installed to develop android, the first thing that comes to mind is to run a write example. You have an intuitive understanding of what Android is. In the Ecplise workspace import book, Android may encounter errors, most of which are SDK versions inconsistent. the following error message is displayed:
Error: Unable to resolve target android-5
Solution: Modify the default value in the project directory. change target = android-5 to target = android-7 (or another version) in the properties file. open the file in txt, save the modification, and run the file.
Appendix:
When you use a later version of the SDK and then import a previously used earlier version of the project, some compatibility issues may occur.
(1) Unable to resolve target android-5
Because the local machine currently uses the 2.1 SDK, the API version is 7, and the imported project uses the 2.0 SDK, and its API version is 5.
Change target = android-5 in default. properties to target = android-7.
However, you must also synchronize AndroidManifest. in xml, replace <uses-sdk android: minSdkVersion = "5"/> with <uses-sdk android: minSdkVersion = "7"/>, otherwise, the system will warn you that the version used is too low during compilation.
(2) After the preceding steps are completed, a new error occurs during compilation: Conversion to Dalvik format failed with error 1.
This is related to the loaded SDK. Right-click the Project build path and choose configure build path... -> the library finds that there is a folder item in the same path in addition to Android 2.1-update1 In the imported JARs. Remove it, clean it, and compile it again.