简体   繁体   English

如何修复错误“转换为dalvik格式失败,错误1”?

[英]how do i fix the error “conversion to dalvik format failed with error 1”?

I did search the site for help and one mentioned to try it with out any thing on the build path except for the android code itself. 我确实在网站上搜索了帮助,并提到要尝试使用该版本,但除了Android代码本身之外,它在构建路径上没有任何其他内容。 and that is all that I have on it! 这就是我所拥有的! I built this with out using any external files. 我没有使用任何外部文件来构建它。 (infact a differnt one that I did do that does work) also I can get it to run in debug mode just fine even putting it on an actual phone and it works I just can't seem to export it. (事实上​​,我确实做到了这一点,但确实可以正常工作),即使将其放在实际的电话上,我也可以使其在调试模式下运行,而且它似乎无法导出。 also to make it even more weird I copied the code to a flash drive and imported it into a differnt computer and with no modifcations i can export it there. 为了使它变得更加怪异,我将代码复制到闪存驱动器并将其导入到其他计算机上,并且无需进行任何修改,我就可以将其导出到那里。 just not here where I need to. 只是不在这里我需要。 I did go and check for updates on everything, nothing appears out of date, least all the "check for updates" tools for eclipse, java and Andorid SDK say so. 我确实去检查了所有内容的更新,没有什么看起来过时,至少所有用于Eclipse,Java和Andorid SDK的“检查更新”工具都这样说。 I did manage to get this from the error log: 我确实设法从错误日志中得到了这个:

Error Stack Trace:
eclipse.buildId=I20110613-1736
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product

Error
Sun Sep 11 21:22:36 EDT 2011
Conversion to Dalvik format failed with error 1

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:663)
at com.android.ide.eclipse.adt.internal.project.ExportHelper.exportReleaseApk(ExportHelper.java:204)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.doExport(ExportWizard.java:290)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.access$0(ExportWizard.java:229)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard$1.run(ExportWizard.java:214)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

Session Data:
eclipse.buildId=I20110613-1736
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product

Try adding -forceprocessing in your proguard.cfg ! 尝试在proguard.cfg中添加-forceprocessing

This was the only thing working for me (cleaning the project or anything else did NOT ). 这是对我工作的唯一的事(清洁项目或其他任何东西都没有 )。 Proguard docs tell: Proguard文档告诉:

Specifies to process the input, even if the output seems up to date. 指定处理输入,即使输出看起来是最新的也是如此。 The up-to-dateness test is based on a comparison of the date stamps of the specified input, output, and configuration files or directories. 最新测试基于指定输入,输出和配置文件或目录的日期戳的比较。

So nothing wrong with that option! 因此,该选项没有错!

I found the answer apparently it's something that broke back in r12, showed up when I updated, thus prompting this question. 我发现答案显然是在r12中中断的,并在更新时出现,从而提示了这个问题。 and now yet again in r14 on which I had to completely uninstall and reinstall everything (including the JDK) to get a proper update. 现在又在r14中,我必须完全卸载并重新安装所有内容(包括JDK)以获得正确的更新。 I thought I was good once I was finally back in able to run the app in test mode on my phone. 我以为自己很高兴,一旦我终于能够在手机上以测试模式运行该应用程序。 but this problem reared it's ugly head again,and I must say it's really "lovely" how little information about what the error is. 但是这个问题再次使人头晕,我必须说,关于什么是错误的信息很少,这真是“可爱”。 but I tried this and it worked when nothing else did!! 但是我尝试了一下,并且在没有其他动作的情况下成功了!

Change 更改

call %java_exe% -jar "%PROGUARD_HOME%"\\lib\\proguard.jar %* 呼叫%java_exe%-jar“%PROGUARD_HOME%” \\ lib \\ proguard.jar%*

to

call %java_exe% -jar "%PROGUARD_HOME%"\\lib\\proguard.jar %1 %2 %3 %4 %5 %6 %7 %8 %9 呼叫%java_exe%-jar“%PROGUARD_HOME%” \\ lib \\ proguard.jar%1%2%3%4%5%6%7%8%9

每次导出之前,清理项目并重新启动Eclipse都对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM