Conversion to Dalvik format failed with error 1 in Android on export

来源:互联网 发布:矩阵式项目管理 编辑:程序博客网 时间:2024/05/22 06:26

在Android打包过程中,遇到这个问题,所以搜索了下在stackoverflow上找到一个解决方案。

解决方案:
It looks like ADT 21 adds a folder to your bin called dexedLibs which ought to speed up deployment by putting jars and libraries in precompiled dex code. I had two versions of the support library there, so I deleted all the files in the folder and built again and it worked. If I try to build with any files in there the build fails though, so I have to delete them before each export. I’m using ActionBar Sherlock and that may be conflicting with the dexedLibs thing because it won’t show up there unless the folder is initially empty.

Edit: I had been using ActionBarSherlock when this problem first came up, but have recently switched to ActionBarCompat. Since the switch, I no longer have to delete the dexedLibs folder when exporting. Looks like maybe ActionBarSherlock was to blame, but I can’t be certain.

意思就是ADT21在我们的bin目录下增加了一个名为dexedLibs的文件夹,它将jar包和libraries放在这里加速打包,这就有两个版本的library,所以删除dexedLibs文件夹即可。

  • dexedLibs目录ADT21以后为了加快编译工程的速度引入的,主要是一些外部库的编译文件,因为在这之前每次Run工程都会编译这些外部库,而ADT21以后就可以一次编译,多次使用了。
  • 刚做了实验,直接把lib文件丢到libs目录中是在Android Private Libraries,这也是ADT21以后加入的,好像会自动把JAR分成Android Private Libraries和Android Dependencies两类。最好都保留。
0 0
原创粉丝点击