安卓霉素ERROR1,无法转换成Dalvik的格式 [英] Android Dx Error1, Failed to convert to Dalvik format

查看:227
本文介绍了安卓霉素ERROR1,无法转换成Dalvik的格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我越来越绝望这个问题:我要导出/有一个额外的的.jar 我加入到构建路径运行我的Andr​​oid应用程序。我敢肯定,我没有把它添加,还有其他5个.jar文件包括在内,他们都做工精细。

I'm getting desperate with this Problem: I want to export/run my Android Application with one additional .jar I added to the buildpath. I'm sure I added it correctly, there are 5 other .jars included and they all work fine.

这个特殊的一个,我得到了提到的错误。 我已经尝试了一切可以在这个问题中找到: <一href="http://stackoverflow.com/questions/2680827/conversion-to-dalvik-format-failed-with-error-1-on-external-jar">"Conversion到的Dalvik格式失败,错误1&QUOT;在外部JAR

with this special one I get the mentioned error. I've already tried everything that can be found in this question: "Conversion to Dalvik format failed with error 1" on external JAR

和其他几个环节谷歌吐出来。主要的问题是,我其实不明白什么消息我想追加的告诉我,因为如果我添加的所有罐子正常javaproject,它运行完全正常......

and several other links google spat out. The main Problem is, I actually do not understand what the message I appended want's to tell me because if I add all the jars to a "normal" javaproject, it runs perfectly fine...

在Android 4.0.3开发,

Developing on Android 4.0.3,

ProGuard的4.8,

proguard 4.8,

ADT 16.0.1.v201112150204-238534,

adt 16.0.1.v201112150204-238534,

日食3.7.1.r37

eclipse 3.7.1.r37

请帮我

[2012-07-18十点45分48秒 - 的myapp]霉素警告:忽略InnerClasses属性的匿名内部   类(iaik.xml.crypto.XSecProvider $ 1)不来的   相关EnclosingMethod属性。这个类是可能产生的   由编译器并没有针对现代.class文件格式。该   推荐的解决方案是重新编译从源的类,用   最多最新的编译器和不指定任何-target类型选项。   无视这一警告的后果是,反射操作   这个类会错误地指出,这是的没有的内   类。

[2012-07-18 10:45:48 - myapp] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class (iaik.xml.crypto.XSecProvider$1) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is not an inner class.

...   ......

... ...

[2012-07-18十点45分48秒 - 的myapp]霉素警告:忽略InnerClasses属性的匿名内部   类(iaik.xml.crypto.XSecProvider $ 2)不来的   相关EnclosingMethod属性。这个类是可能产生的   由编译器并没有针对现代.class文件格式。该   推荐的解决方案是重新编译从源的类,用   最多最新的编译器和不指定任何-target类型选项。   无视这一警告的后果是,反射操作   这个类会错误地指出,这是的没有的内   类。

[2012-07-18 10:45:48 - myapp] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class (iaik.xml.crypto.XSecProvider$2) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is not an inner class.

不明智或核心类错误的使用(Java。*或使用javax。*)时,   不是建设一个核心库。

Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library.

这通常是因为不经意间,包括在核心库文件   您的应用程序的项目,使用的IDE(如Eclipse)时。如果   你确定你不是故意定义核心类,那么这   是发生了什么事情最有可能的解释。

This is often due to inadvertently including a core library file in your application's project, when using an IDE (such as Eclipse). If you are sure you're not intentionally defining a core class, then this is the most likely explanation of what's going on.

不过,你实际上可能试图在核心定义一个类   命名空间,它的可能采取,例如,从一个源   非Android虚拟机项目。这将最稳妥不   工作。至少,它危害您的应用程序的兼容性   该平台的未来版本。它是有问题也常常   合法性。

However, you might actually be trying to define a class in a core namespace, the source of which you may have taken, for example, from a non-Android virtual machine project. This will most assuredly not work. At a minimum, it jeopardizes the compatibility of your app with future versions of the platform. It is also often of questionable legality.

如果你真的打算建立一个核心库 - 这是唯一   合适的,创建一个完整的虚拟机分配的一部分,   而不是编译应用程序 - 然后使用   --core库选项晚饭preSS此错误消息。

If you really intend to build a core library -- which is only appropriate as part of creating a full virtual machine distribution, as opposed to compiling an application -- then use the "--core-library" option to suppress this error message.

如果您继续使用--core库,但实际上建设   应用程序,然后谅解,您的应用程序仍然会失败   建设或运行,在某些时候。请ppared为愤怒的客户$ P $   谁找到,例如,您的应用程序停止运行一次   他们升级操作系统。你会责怪这个   问题。

If you go ahead and use "--core-library" but are in fact building an application, then be forewarned that your application will still fail to build or run, at some point. Please be prepared for angry customers who find, for example, that your application ceases to function once they upgrade their operating system. You will be to blame for this problem.

如果您是合法使用一些code恰好是在核心   包,那么最简单安全的替代你已经是重新打包   这code。也就是说,移动类的问题到你自己的包   命名空间。这意味着他们将永远不会与核心冲突   系统类。 JarJar是一个工具,它可以帮助你在这一努力。   如果你发现你不能做到这一点,那么这是一个迹象表明,   你是在路径最终会导致疼痛,痛苦,悲伤,   而悲叹。

If you are legitimately using some code that happens to be in a core package, then the easiest safe alternative you have is to repackage that code. That is, move the classes in question into your own package namespace. This means that they will never be in conflict with core system classes. JarJar is a tool that may help you in this endeavor. If you find that you cannot do this, then that is an indication that the path you are on will ultimately lead to pain, suffering, grief, and lamentation.

[2012-07-18十点45分48秒 - 的myapp]霉素1的错误;中止

[2012-07-18 10:45:48 - myapp] Dx 1 error; aborting

[2012-07-18十点45分48秒 - 的myapp]转换为Dalvik的格式   失败,出现错误1

[2012-07-18 10:45:48 - myapp] Conversion to Dalvik format failed with error 1

这是我的项目看起来诠释他探险家:

This is how my project looks int he explorer:

推荐答案

现在的问题是,你是其中的jar有一个class在Java。*或使用javax。*命名空间。 DX不允许这样,因为提到的最后一个大的错误消息。

The problem is that the jar you are including has a class in the java.* or javax.* namespace. dx does not allow this, as mentioned in the last big error message.

如果你确实需要这些类,你需要将其移动到不同的包中,使用类似的jarjar工具。否则,你需要从罐子里取出它们 - 这可能有ProGuard的将其删除之前,一切都被dx​​'d,我不知道

If you actually need these classes, you'll need to move them to a different package, using something like the jarjar tool. Otherwise, you'll need to remove them from the jar -- it may be possible to have proguard to remove them before everything gets dx'd, I'm not sure.

这篇关于安卓霉素ERROR1,无法转换成Dalvik的格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆