SoFunction
Updated on 2025-03-11

Solution to the loss of Android system library or Conversion to Dalvik format failed with error 1

This article analyzes the solution to the loss of Android system library or Conversion to Dalvik format failed with error 1 error. Share it for your reference, as follows:

Many problems that arise when developing Android projects in eclipse can be easily solved using Project-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

But if the Android library is not found, or the Android system library is accidentally removed, how can I add the Android system library again? In the Java Build Path in eclipse, it is impossible to add a system library defined in Android 2.1. I tried to manually add the SDK folder, and the problem of Conversion to Dalvik format failed with error 1 occurred. After a while, many netizens said that using Project clean can solve it, but it is useless to my situation. I found a solution on Baidu: Modify the project classpath file, which made me understand, and directly put it in other normal projects

Copy the codeThe code is as follows:
<classpathentry kind="lib"   path ="custom jar address" />

Modify to
Copy the codeThe code is as follows:
<classpathentry kind="con" path=".ANDROID_FRAMEWORK"/>
Refreshing the project in this way, Android system library Android 2.1 has returned, and the error has also been solved.

I have encountered this problem again these days, but the .classpath file already contains the above con Path, and later in the forum (/) Find the new method on:
project -> properties -> android label, check a target from the project build target list

Attached to the widely circulated solutions on the Internet:Solution to dalvik format failed with error 1

The above error may occur when Android low-version projects (such as 1.5) are placed in a higher-version environment (such as 2.2). The solution is as follows:

1. If you do not modify the Android SDK version, use the project clean command to act on a project. (This processing method is only compatible with low-version projects in the higher version and is not truly upgraded)

2. If you modify the Android SDK version, you need the following steps:

1) Modify the SDK

Select the project, build path --> configure build path ---> library to delete the referenced lower version SDK,
Then add External JARs, select the higher version SDK, OK, save

2) Modify the classpath file

This item may exist in this file: <classpathentry kind="lib"   path ="The address of the higher version you specified"
Modify her to

Copy the codeThe code is as follows:
<classpathentry kind="con" path=".ANDROID_FRAMEWORK" />

3) Modify

In the file, add the application tag after the

Copy the codeThe code is as follows:
<uses-sdk android:minSdkVersion="3"></uses-sdk>

4) Modification (very important)

The last line of the file (the previous one was useless #) target=android-3 is the target=android-8 and save.

Let’s take a look at the same structure as the newly built android 2.2 project.

I hope this article will be helpful to everyone's Android programming design.