Tag Archives: Basic theory

Conversion to dalvik format failed with error 1 solution

Note: transfer to http://dev.wo.com.cn/docportal/doc_queryMdocDetail.action?Mdoc docindex = 6540
 
Resource description:

1. If you do not modify the Android SDK version, use the Project Clean command to work on a project.
(this process is only compatible with the lower version of the project in the higher version, not a real upgrade)

2. If the android SDK version is modified, the following steps are required:

1) modify the SDK

select project, buildpath –> configure build path —> Library delete the lower version of referenced SDK,
then add ExternalJARs, select the higher version SDK,OK, save

2) modify the classpath file

the file may have this item :< Classpathentry kind=”lib” path =” higher version address you specify “
change her to < classpathentrykind=”con”path=”com.android.ide.eclipse.adt.ANDROID_FRAMEWORK” />

3) modify androidmanifest.xml

add &lt after the application tag in the androidmanifest.xml file; uses-sdkandroid:minSdkVersion=”3″> < /uses-sdk>

4) modify default.properties (very important)

the last line of the file (not used in the previous #) target=android-3 target=android-8, save.
look again at your project and the new android2.2 project structure. 3. Many problems occurred in the development of Android Project in eclipse can be used to Project– > Clean is easy to solve.
but if it appears that the Android library cannot be found, or accidentally removed the Android library, how can you add the Android library again?

in eclipse Java Build Path can not add such as Android 2.1 defined system libraries. However, I tried to manually add android.jar in the SDK folder
, which showed a Conversion to Dalvik format failed with error 1. After playing around with
for a while, many users said that using Projectclean would solve the problem, but in my case, it was useless.

solution:

modify the project classpath file, which makes me understand, directly from other normal projects into the
< ! Note that this.classpath file is located in the Eclipse workspace hard disk location under the project directory –>
< Classpathentry kind=”lib”path =” Address of custom JAR “/>

modified to www.2cto.com
< classpathentry kind=”con”path=”com.android.ide.eclipse.adt.ANDROID_FRAMEWORK”/> .

like this refresh project, Android system library Android 2.1 is back, that error is resolved.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
this several days again encountered such a problem, however. The classpath file already contains the above con inside Path, then found a new method on BBS:

project -> properties -> androidlabel, check a target from the project build target list

< ! — Sometimes the error cannot be removed. At this time, please pay attention when entering project-> properties -> After android, there is a
is library item below, tick it, and then click “OK”. This is how my error was solved. At first, I could not solve it according to
above and the following methods.
(is library)
(is library)
(is library)
(is library)
; There is another case: the package conflict, please go to the project directory to remove the same package, re-import one, this is similar to the first case, but this is for other packages, not android package

solution: Java Build Path-> Libraries-> JARs and class folders on thebuild path
see if there are identical JARs some jar versions are not necessarily android JARs other library JARs can also cause such errors
last time signpost-core-1[1].2.1.1.jar and signpost-core-1.2.1.1.jar conflicts this occurs so you have to see if there are identical JARs

Compared with before is the fourth kind of situation, I’m from others that take an examination of a andengine game engine code, me to his libs folder is set as the source folder, and then put inside the jar package add to the buildpath, then came the problem of subject, checked a lot of solution, no solution, then carefully observed my question and the fourth is like, put the jar all removed, and then reload time, under this solved, ha ha, here the method summary posted, convenient viewing.