(ADT 21)转换为Dalvik的格式,Android的出口失败,错误1转换为、错误、格式、ADT

2023-09-04 04:54:11 作者:囚神

我知道这个问题的一种形式是在那里,但我找不到任何专门适合我的情况,所以在这儿呢。

I know a form of this question is out there, but I can't find anything specifically that fits my scenario, so here it is.

我的应用程序编译,并在模拟器中进行测试时完美运行,但是当我尝试导出一个签名的apk我得到的转换到的Dalvik格式失败,出现错误1 。 Eclipse的错误日志显示该堆栈跟踪:

My app compiles and runs perfectly when testing in the emulator, but when I try to export a signed apk I get the Conversion to Dalvik format failed with error 1. The Eclipse error log shows this stack trace:

com.android.ide.eclipse.adt.internal.build.DexException: Conversion to Dalvik format failed with error 1
at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:751)
at com.android.ide.eclipse.adt.internal.project.ExportHelper.exportReleaseApk(ExportHelper.java:269)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.doExport(ExportWizard.java:296)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.access$0(ExportWizard.java:233)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard$1.run(ExportWizard.java:218)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

我没有命名冲突,其他人似乎有(至少不会这么说的错误),而我难倒,为什么它运行在模拟器,但我不能出口。

I don't have the naming collisions that other people seem to have (at least it doesn't say so in the error), and I'm stumped as to why it runs in the emulator, but I can't export.

我不使用ProGuard的两种,顺便说一句。

I'm not using ProGuard either, by the way.

推荐答案

它看起来像ADT 21将文件夹添加到你的bin称为dexedLibs它应该通过把罐子和图书馆precompiled DEX $ C $,以加快部署C。我有两个版本的支持库有,所以我删除的文件夹中的所有文件,并重新建造和它的工作。如果我尝试建立与在那里构建尽管失败的任何文件,所以我每次出口之前删除它们。我使用的ActionBar福尔摩斯,并且可能是相互冲突的dexedLibs的事情,因为它不会出现在那里,除非该文件夹最初是空的。

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.

编辑:我一直在使用 ActionBarSherlock 此问题时,第一次来到了,但最近已切换到ActionBarCompat.由于开关,我再也不用导出时删除dexedLibs文件夹。看起来也许ActionBarSherlock是罪魁祸首,但我不能肯定。

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.