最近的很多项目老是出现标题Conversion to Dalvik format failed with error 1的错误,有的时候处理了好几天都没有到到结果,在自己的摸索之下,最后还是顺利的解决了以上的问题,出现这种情况的主要原因是因为升级了adt,新版本的adt更新了很多不同的东西,导致有些老项目在新的eclipse开发环境中出现问题,具体的问题分几种情况

以下是我自己总结的解决办法

第一种情况:由于使用了代码混淆出现上面的错误

碰到过,通过以下方式解决问题

解决办法: 如果代码不重要的话直接去掉混淆吧,有效,网上说的很多在使用了没有效果

第二种情况,由于项目引用了两个android.jar文件导致不能编译通过

碰到过,通过以下方式解决,建议使用一个版本的sdk的android.jar包, 不然会出现兼容性的错误

———————————————-分割线———————————————————————–

以下是网上的部分人的解决办法, 我试了没有作用

第一种:

I ran into this issue after updating to the October 2011 r15 version of ADT and SDK. My project uses 3 projects as libraries, so there is a lot of interdependence between the projects. This error comes up (I believe) when the build tool sees the same object get defined multiple times. My guess is Google changed up how the library references work, so my old project setup was no longer valid.

I tried messing with the project’s library and build path settings, but I couldn’t get the build to be stable. The solution I came up with was to:

  1. Close Eclipse
  2. Make a backup copy of the workspace
  3. Delete the .project and .classpath files in each project
  4. Open a new workspace in Eclipse
  5. Add the project back in using the New Android Project wizard (selecting "Create project from existing source"). Note: This is different from importing an existing project.

After I set up the library dependencies in the new workspace, everything compiled just fine. I had a lot of settings I didn’t want to lose, so I copied the regenerated .project and .classpath files back into my original workspace and it has been working alright for me so far.