41

I am new to Android and am using the Ical4j library for parsing ICS (Outlook calendar) files.

However, when I build my application in Eclipse, the following warning appears many times in the console:

[2010-07-22 15:58:31 - Google Calendar Upload] warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)

Which implications does this have? How can I resolve this?

William
  • 20,150
  • 8
  • 49
  • 91
RMK
  • 779
  • 3
  • 9
  • 13

4 Answers4

31

If your app and your libraries have all been built with a new JDK (7+) and you are still getting this, then you can fix this problem by telling Proguard to keep the enclosing method attribute. Just add the following to your Proguard rules:

-keepattributes EnclosingMethod

William
  • 20,150
  • 8
  • 49
  • 91
  • no effect for me. what helped me was Cleaning the Project then Make Project. – Belial09 Jun 01 '16 at 09:17
  • 3
    This warning quoted by OP is coming from DEX, not ProGuard; I'm compiling test sources and I don't see how adding a ProGuard option, which is not used would help. – TWiStErRob Aug 17 '16 at 10:08
  • This works for code wrote in the project but doesn't work for jar libraries already obfuscated without this configuration. But I guess there is probably no way to improve that. – hqzxzwb May 10 '17 at 06:33
29

This is quite common when including jar files. Although the warning isn't anything to worry about if you are just using the API normally, you should be able to get rid of them by compiling ical4j yourself from source within Eclipse (either build a new jar, or just drop the source into your own source folder). Though I should stress that unless you actually get problems, this isn't something to worry about.

Nick
  • 11,475
  • 1
  • 36
  • 47
4

I had the same error when using ksoap2 library.

To get rid of it I downloaded DJ Java Decompiler to decompile the .jar file to .java files. After that i compiled the .java files to a .jar file using eclipse.

Atanas
  • 9
  • 2
Dominik Mohr
  • 827
  • 9
  • 19
  • 6
    You can just recompile from source rather than decompiling. It is on github. Also this problem comes from ksoap2-android being compiled for java 1.3. – Manfred Moser Aug 05 '11 at 20:17
  • 1
    I didn't found the right sources for the version i was using but thanks for your comment. – Dominik Mohr Aug 08 '11 at 14:33
1

Update build tools and support libraries to the same version

k4dima
  • 6,070
  • 5
  • 41
  • 39
  • 1
    Though this answer could have more detail about `why` this would help this is not a wrong answer... It just doesn't help a lot understanding the problem – MOnsDaR May 17 '17 at 09:23