Dx warning: Ignoring InnerClasses .. for org.apache.tools.ant

1.6k views Asked by At

I encountered this set of warnings which made memory overflow and eventually crashed Eclipse.

This is an Android application with twitter4J core jar included as a reference library. This is using Google APIs (com.google.android.) so I set the target to Google APIs not general ADK.

Here's the problem.

[2011-11-18 08:29:24 - Twitter] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class (org.apache.tools.ant.taskdefs.Parallel$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.

This kind of warning continues to an amount of approx 20 inner classes (about 6 in taskdefs), and all inner classes mentioned in the console are from org.apache.tools.ant.

I updated Java SE 6 to 1.6 for Mac OS X Lion with http://mac.softpedia.com/get/System-Utilities/Java.shtml,

but still the problem exists. Should I upgrade my ant? my ant version is 1.8.2.

2

There are 2 answers

0
AnswerZhao On

This happen when compile the project.Just add this follow into your proguard-rules.pro file. The warning will disappear.

-keepattributes EnclosingMethod
0
Kim On

This is a result of some of the used libraries having been compiled with JDK 1.4 or earlier. The solution is to recompile it all into new .jar files for Android Mock to use