将aspectjtools.jar用于Android项目

时间:2012-03-05 16:00:31

标签: android aspectj

我在Android项目中导入了 aspectjtools.jar ,但是当我运行项目时(无论我是否在代码中使用.jar),eclipse都会显示以下警告:

[2012-03-05 16:34:20 - AndroidExample] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.aspectj.ajdt.internal.compiler.CompilerAdapter$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-03-05 16:34:20 - AndroidExample] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.aspectj.org.eclipse.jdt.core.ClasspathContainerInitializer$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.

在多次显示相同的警告后,Eclipse停止工作,我必须重新启动它。

我尝试使用Maven,但它显示了相同的警告,并在显示警告1分钟后,项目编译但不能正常工作。

如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

您显然需要修改Eclipse配置,以便在字节码编译和转换为Android .dex格式之间进行编织。请参阅this article