To learn about Android application development, learning Source Code is one of the best ways. So I downloaded a source code: mycontacts address book. Open eclipse and use import to import the source code. An error occurs in the project.
1. Application Development Kit errors: none of all import Android. *; errors of this class library are reported. Okay, this source code does not carry the android SDK, So I clicked the project and right-click build.
Path, click Add external archivees, and find the Lib library Directory D: \ Program Files \ Android-SDK \ platforms \ Android-10 in the selection box. jar, select the JAR file to confirm the import, and the application package error of the Project disappears immediately.
2. All errors in the project package disappear, but the project still has a wrong cross-fork. If you want to run it, try again and the system prompts that an error cannot be run. Well, if it's not about the application file, it's about the entire project. It's estimated that the information is not consistent, maybe it's about version information?
Open the project of the project. properties, according to the description of the QQ group friends, find the SDK version information used for the entire project is target = Android-5, which obviously does not match the local sdk I installed yesterday, look at the Directory and you will know that I am running Android-10 locally. change target = Android-5 to target = Android-10 in the properties file. Refresh the file and the error disappears.
III. continue running, or error: conversion to Dalvik format failed with error 1, throwing this information to the Internet for search, saying that the android earlier version Project (such as 1.5) is put into a later version environment (such as 2.2) the above error may occur. Add the following solution:
========================================================== ========================================================== =
1. If the android SDK version is not modified, use the Project Clean command to act on a project.
(This processing method is only compatible with lower-version projects in the high version and is not truly upgraded)
2. If you want to modify the android SDK version, perform the following steps:
1) modify the SDK
Select the project, build path --> Configure build path ---> library to delete the referenced low-version SDK,
Add external jars, select SDK of later version, OK, and save
2) modify the classpath File
This file may contain this item: <classpathentry kind = "lib" Path = "Your specified High Version address"
Change her to <classpathentry kind = "con" Path = "com. Android. Ide. Eclipse. ADT. android_framework"/>
3) Modify androidmanifest. xml
In the androidmanifest. xml file, add the <uses-SDK Android: minsdkversion = "3"> </uses-SDK>
4) Modify default. properties (important)
Target = Android-3 in the last line of the file (not used in the previous step), and save it as target = Android-8.
Let's take a look at your project and the new Android 2.2 project structure.
========================================================== ========================================================== =
4. I used the first method project clean. The result is invalid and depressing. Corresponding to the second method, the information is modified, or the error is returned.
I looked online and said:
========================================================== ========================================================== =
Http://blog.sina.com.cn/s/blog_70fd7a7b0100wp7b.html
... In fact, this error is very simple. You have more than one jar package in the project, so Delete the other, leave a jar package, and then re-run the project...
========================================================== ========================================================== =
With some inspiration, is it repeated? Is step 1 unnecessary, but will the jar package of Android 2.3.3 be automatically added to this project when Project Clean is used? So I clicked build.
Path, click Configure build path, open the interface, and you have already manually added android. jar, And the android 2.3.3lib library automatically added by the system, so I removed the previously manually associated jar and sorted out androidmanifest by the way. for XML, refer to my hello project configuration file and move the following three lines to the front. Otherwise, there will always be a wave line prompt, Which is uncomfortable. This should be irrelevant to the overall situation.
<Uses-SDK Android: minsdkversion = "10"/>
<Uses-Permission Android: Name = "android. Permission. call_phone"> </uses-Permission>
<Uses-Permission Android: Name = "android. Permission. send_sms"> </uses-Permission>
<Uses-Permission Android: Name = "android. Permission. receive_sms"
/>
Well, in this step, run as Android project as scheduled, which is very good.