[Android Development Notes] Unable to resolve target & amp; #39; android-5

Source: Internet
Author: User

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.

Related Article

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.