简体   繁体   English

在eclipse中转换为dalvik格式失败,并显示错误1(添加gnu-crypto.jar时)

[英]Conversion to dalvik format failed with error 1(when adding gnu-crypto.jar) in eclipse

There are a lot of questions similar to this one but I've tried everything and it didn't help. 有很多与此问题类似的问题,但是我已经尝试了所有问题,但没有帮助。

The error is: 错误是:

stack[top0]: type{java.lang.InterruptedException}
...while working on block 01d0
...while working on method handleConfirmation:(Ljavax/security/auth/callback/ConfirmationCallback;)V
...while processing handleConfirmation (Ljavax/security/auth/callback/ConfirmationCallback;)V
...while processing gnu/crypto/auth/callback/AWTCallbackHandler.class

[2012-01-21 15:31:22 - AppName] Dx 1 error; aborting
[2012-01-21 15:31:22 - AppName] Conversion to Dalvik format failed with error 1

This happens only when I try to add external jar for encryption - gnu-crypto.jar. 仅当我尝试添加外部jar进行加密时,才会发生这种情况-gnu-crypto.jar。 What I've tried: 我尝试过的

  • Project -> Clean 项目->清洁
  • Deleting project from eclipse and reimporting it 从Eclipse中删除项目并重新导入
  • Changing proguard files(bin and lib directories) to the newest 将proguard文件(bin和lib目录)更改为最新的
  • Changing java -jar "%PROGUARD_HOME%"\\lib\\proguard.jar %* to java -jar "%PROGUARD_HOME%"\\lib\\proguard.jar %1 %2 %3 %4 %5 %6 %7 %8 %9 将java -jar“%PROGUARD_HOME%” \\ lib \\ proguard.jar%*更改为java -jar“%PROGUARD_HOME%” \\ lib \\ proguard.jar%1%2%3%4%5%6%7%8%9
  • Unchecking "Force error when external jars contain native libraries" option (just as you did) and the cleaning project 取消选中“当外部jar包含本机库时出现强制错误”选项(与您一样)和清理项目
  • Removing all jar files from the Java Build Path, then Android Tools -> Fix project properties, and adding external jar again 从Java构建路径中删除所有jar文件,然后从Android工具->修复项目属性中删除,然后再次添加外部jar

It appears that there's something wonky with the 2.1.0 release of gnu-crypto. 似乎gnu-crypto的2.1.0版本有些奇怪。 Running dx on it manually produces the error you mentioned. 手动运行dx会产生您提到的错误。

You could try adding the sources for gnu-crypto to your application directly, or use the 2.0.1 release instead. 您可以尝试将gnu-crypto的源直接添加到您的应用程序中,或者改用2.0.1版本。

Make sure you delete all the potentially double reference to jars with similar classes. 确保删除对具有相似类的jar的所有可能的双重引用。 This could happen by referring to different versions of android or having reference to android and jdk or a jre. 通过引用不同版本的android或引用android和jdk或jre可能会发生这种情况。

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

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