安卓4.0的Eclipse编译失败 [英] Android 4.0 Eclipse compilation failed

查看:124
本文介绍了安卓4.0的Eclipse编译失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我切换到Android 4.0使用Eclipse的应用程序developent。升级后,我得到下面的异常。有任何想法吗?提到从Eclipse项目中移除了Android库中的一些博客文章更新的项目配置,但不起作用。

  [2011-10-27二十二点29分27秒 -  ...]霉素警告:忽略InnerClasses属性匿名内部类
(org.apache.commons.logging.impl.LogFactoryImpl $ 1)不来的
相关EnclosingMethod属性。这个类可能是由一个生产
编译器并没有针对现代.class文件格式。推荐
的解决方案是重新编译从源的类,使用最多的最新的编译器
并且不指定任何-target类型选项。忽视的后果
这个警告是在此类反射操作将不正确
表明它是*不*内部类。
[2011-10-27 22点29分27秒 -  ...]霉素警告:忽略InnerClasses属性匿名内部类
(org.apache.commons.logging.impl.LogFactoryImpl $ 2)不来的
相关EnclosingMethod属性。这个类可能是由一个生产
编译器并没有针对现代.class文件格式。推荐
的解决方案是重新编译从源的类,使用最多的最新的编译器
并且不指定任何-target类型选项。忽视的后果
这个警告是在此类反射操作将不正确
表明它是*不*内部类。
[2011-10-27 22点29分27秒 -  ...]霉素警告:忽略InnerClasses属性匿名内部类
(org.apache.commons.logging.impl.LogFactoryImpl $ 3)不来的
相关EnclosingMethod属性。这个类可能是由一个生产
编译器并没有针对现代.class文件格式。推荐
的解决方案是重新编译从源的类,使用最多的最新的编译器
并且不指定任何-target类型选项。忽视的后果
这个警告是在此类反射操作将不正确
表明它是*不*内部类。
[2011-10-27 22点29分27秒 -  ...]霉素警告:忽略InnerClasses属性匿名内部类
(org.apache.commons.logging.impl.SimpleLog $ 1)不来的
相关EnclosingMethod属性。这个类可能是由一个生产
编译器并没有针对现代.class文件格式。推荐
的解决方案是重新编译从源的类,使用最多的最新的编译器
并且不指定任何-target类型选项。忽视的后果
这个警告是在此类反射操作将不正确
表明它是*不*内部类。
[2011-10-27 22点29分27秒 -  ...]霉素警告:忽略InnerClasses属性匿名内部类
(org.apache.commons.logging.impl.WeakHashtable $ 1)不来的
相关EnclosingMethod属性。这个类可能是由一个生产
编译器并没有针对现代.class文件格式。推荐
的解决方案是重新编译从源的类,使用最多的最新的编译器
并且不指定任何-target类型选项。忽视的后果
这个警告是在此类反射操作将不正确
表明它是*不*内部类。
[2011-10-27 22点29分27秒 -  ...]霉素警告:忽略InnerClasses属性匿名内部类
(org.apache.commons.logging.LogFactory $ 1)不来的
相关EnclosingMethod属性。这个类可能是由一个生产
编译器并没有针对现代.class文件格式。推荐
的解决方案是重新编译从源的类,使用最多的最新的编译器
并且不指定任何-target类型选项。忽视的后果
这个警告是在此类反射操作将不正确
表明它是*不*内部类。
[2011-10-27 22点29分27秒 -  ...]霉素警告:忽略InnerClasses属性匿名内部类
(org.apache.commons.logging.LogFactory $ 2)不来的
相关EnclosingMethod属性。这个类可能是由一个生产
编译器并没有针对现代.class文件格式。推荐
的解决方案是重新编译从源的类,使用最多的最新的编译器
并且不指定任何-target类型选项。忽视的后果
这个警告是在此类反射操作将不正确
表明它是*不*内部类。
[2011-10-27 22点29分27秒 -  ...]霉素警告:忽略InnerClasses属性匿名内部类
(org.apache.commons.logging.LogFactory $ 3)不来的
相关EnclosingMethod属性。这个类可能是由一个生产
编译器并没有针对现代.class文件格式。推荐
的解决方案是重新编译从源的类,使用最多的最新的编译器
并且不指定任何-target类型选项。忽视的后果
这个警告是在此类反射操作将不正确
表明它是*不*内部类。
[2011-10-27 22点29分27秒 -  ...]霉素警告:忽略InnerClasses属性匿名内部类
(org.apache.commons.logging.LogFactory $ 4)不来的
相关EnclosingMethod属性。这个类可能是由一个生产
编译器并没有针对现代.class文件格式。推荐
的解决方案是重新编译从源的类,使用最多的最新的编译器
并且不指定任何-target类型选项。忽视的后果
这个警告是在此类反射操作将不正确
表明它是*不*内部类。
[2011-10-27 22点29分27秒 -  ...]霉素警告:忽略InnerClasses属性匿名内部类
(org.apache.commons.logging.LogFactory $ 5)不来的
相关EnclosingMethod属性。这个类可能是由一个生产
编译器并没有针对现代.class文件格式。推荐
的解决方案是重新编译从源的类,使用最多的最新的编译器
并且不指定任何-target类型选项。忽视的后果
这个警告是在此类反射操作将不正确
表明它是*不*内部类。
[2011-10-27 22点29分27秒 -  ...]霉素警告:忽略InnerClasses属性匿名内部类
(org.apache.commons.logging.LogFactory $ 6)不来的
相关EnclosingMethod属性。这个类可能是由一个生产
编译器并没有针对现代.class文件格式。推荐
的解决方案是重新编译从源的类,使用最多的最新的编译器
并且不指定任何-target类型选项。忽视的后果
这个警告是在此类反射操作将不正确
表明它是*不*内部类。
[2011-10-27 22点29分28秒 -  ...]霉素
故障处理的javax / XML /解析器/ DocumentBuilder.class:

不明智或核心类错误的使用(Java。*或使用javax。*)
如果没有建立一个核心库。

这往往是由于在不经意间,包括一个核心库文件
在你的应用程序的项目,使用IDE时(如
蚀)。如果你确定你不是故意定义
核心类,那么这是一个什么样的最可能的解释
怎么回事。

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

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

如果继续使用--core库,但实际上
构建一个应用程序,然后谅解,您的应用程序
将仍然无法生成或运行,在某些时候。请
prepared为愤怒的客户谁找到,例如,您的
应用程序停止运行,一旦他们提升自己的工作
系统。你会责怪这个问题。

如果您正在使用合法的一些code恰好是在
核心包,那么最简单安全的替代你是
重新包装一下code。也就是说,移动类问题成
你自己的包的命名空间。这意味着他们将永远不会在
冲突的核心系统类。 JarJar是一种工具,可以帮助
您在这方面。如果你发现你不能做到这一点,那么
即表明该路径你在将最终
导致疼痛,痛苦,悲伤和悔恨。

[2011-10-27 22点29分28秒 -  ...]霉素1的错误;中止
[2011-10-27 22点29分28秒 -  ...]转换为的Dalvik格式失败,错误1
 

解决方案

您使用Maven和m2eclipse的-机器人集成的Eclipse插件的机会?我看到完全相同的错误,因为升级到SDK R14,但是我仍然为建设目标为Android 2.2。我的项目构建和部署到模拟器当我运行命令行的Maven构建:

  MVN干净安装Android:部署
 

这是它的工作原理Eclipse之外这一事实使被认为是m2eclipse的,Android的整合插件,是造成问题的原因。我已经看了他们的网站(链接),它看起来像它有显著改变,因为我开始使用它。也许升级,这将帮助,我还没有尝试过呢。我会让你知道。

Today I switched to Android 4.0 for app developent using Eclipse. After upgrading I get the following exception. Any ideas? Some blog entries mentioned to remove the Android library from the Eclipse project update the project configuration, but this does not work.

[2011-10-27 22:29:27 - ...] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.impl.LogFactoryImpl$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.
[2011-10-27 22:29:27 - ...] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.impl.LogFactoryImpl$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.
[2011-10-27 22:29:27 - ...] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.impl.LogFactoryImpl$3) 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.
[2011-10-27 22:29:27 - ...] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.impl.SimpleLog$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.
[2011-10-27 22:29:27 - ...] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.impl.WeakHashtable$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.
[2011-10-27 22:29:27 - ...] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$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.
[2011-10-27 22:29:27 - ...] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$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.
[2011-10-27 22:29:27 - ...] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$3) 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.
[2011-10-27 22:29:27 - ...] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$4) 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.
[2011-10-27 22:29:27 - ...] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$5) 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.
[2011-10-27 22:29:27 - ...] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.logging.LogFactory$6) 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.
[2011-10-27 22:29:28 - ...] Dx 
trouble processing "javax/xml/parsers/DocumentBuilder.class":

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

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.

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.

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.

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.

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.

[2011-10-27 22:29:28 - ...] Dx 1 error; aborting
[2011-10-27 22:29:28 - ...] Conversion to Dalvik format failed with error 1

Are you by chance using Maven and the m2eclipse-android-integration plugin for Eclipse? I am seeing the exact same error since upgrading to sdk r14, however I am still targeting by build for Android 2.2. My project builds and deploys to the emulator when I run the maven build from the command line:

mvn clean install android:deploy

The fact that it works outside of Eclipse makes be believe that it is the m2eclipse-android-integration plugin that is causing the problem. I've looked at their site (link) and it looks like it has changed significantly since I started using it. Maybe upgrading that will help, I haven't tried that yet. I'll let you know.

这篇关于安卓4.0的Eclipse编译失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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