2011-10-27 155 views
4

今天我转向使用Eclipse开发应用程序的Android 4.0。升级后,我得到以下异常。有任何想法吗?一些提到的从Eclipse项目中移除Android库的博客条目会更新项目配置,但这不起作用。Android 4.0 Eclipse编译失败

[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 
+0

这是适用的? http://android-developers.blogspot.com/2011/10/changes-to-library-projects-in-android.html – Ian

+1

就是这样。 Maven插件创建一个Android依赖项,Eclipse项目也链接到一个Android库。这是问题所在。现在我必须从我的pom文件中删除Android Dep。提供的作用域的依赖不能解决它。所以我必须删除dep,如果我想用Eclipse构建项目并使用Maven构建它。不完美的方式:-( – CannyDuck

+0

即时通讯有问题的更新,但在java开发中使用eclipse和它的web应用程序使用maven plugin.any定期获取更新的想法? – moh89

回答

2

您是否偶然使用Maven和适用于Eclipse的m2eclipse-android-integration插件?自从升级到sdk r14后,我看到了完全相同的错误,但是我仍然通过为Android 2.2构建目标。我的项目的基础,当我在命令行运行Maven构建部署到模拟器:

mvn clean install android:deploy 

,它的作品Eclipse之外的事实使得可以认为,这是导致m2eclipse的,Android系统的集成插件问题。我查看了他们的网站(link),看起来它自从我开始使用以来已经发生了显着变化。也许升级会有所帮助,我还没有尝试过。我会告诉你。

+0

它看起来像一个相关的[bug](https://代码。 google.com/p/maven-android-plugin/issues/detail?id=214#c0)已提交。 –