I've got this:
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$1: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$Itr
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$2: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$Itr
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$RandomAccessWrappedList: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$RandomAccessWrappedList: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedList
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$SortedAsMap: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$AsMap
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$SortedKeySet: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$KeySet
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedList: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedList: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedList$WrappedListIterator: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedList$WrappedListIterator: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection$WrappedIterator
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedSet: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedSortedSet: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedSortedSet: can't find referenced class com.squareup.haha.guava.collect.AbstractMapBasedMultimap$com.squareup.haha.guava.collect.AbstractMapBasedMultimap$WrappedCollection
Warning: com.squareup.haha.guava.collect.AbstractMultimap$EntrySet: can't find referenced class com.squareup.haha.guava.collect.AbstractMultimap$com.squareup.haha.guava.collect.AbstractMultimap$Entries
Warning: com.squareup.haha.guava.collect.ImmutableMultimap$1: can't find referenced class com.squareup.haha.guava.collect.ImmutableMultimap$com.squareup.haha.guava.collect.ImmutableMultimap$Itr
Warning: com.squareup.haha.guava.collect.ImmutableMultimap$2: can't find referenced class com.squareup.haha.guava.collect.ImmutableMultimap$com.squareup.haha.guava.collect.ImmutableMultimap$Itr
Warning: com.squareup.haha.guava.collect.MapMakerInternalMap$EntryIterator: can't find referenced class com.squareup.haha.guava.collect.MapMakerInternalMap$com.squareup.haha.guava.collect.MapMakerInternalMap$HashIterator
Warning: com.squareup.haha.guava.collect.MapMakerInternalMap$HashIterator: can't find referenced class com.squareup.haha.guava.collect.MapMakerInternalMap$com.squareup.haha.guava.collect.MapMakerInternalMap$com.squareup.haha.guava.collect.MapMakerInternalMap$WriteThroughEntry
Warning: com.squareup.haha.guava.collect.MapMakerInternalMap$HashIterator: can't find referenced class com.squareup.haha.guava.collect.MapMakerInternalMap$com.squareup.haha.guava.collect.MapMakerInternalMap$com.squareup.haha.guava.collect.MapMakerInternalMap$WriteThroughEntry
Warning: com.squareup.haha.guava.collect.MapMakerInternalMap$HashIterator: can't find referenced class com.squareup.haha.guava.collect.MapMakerInternalMap$com.squareup.haha.guava.collect.MapMakerInternalMap$WriteThroughEntry
Warning: com.squareup.haha.guava.collect.MapMakerInternalMap$KeyIterator: can't find referenced class com.squareup.haha.guava.collect.MapMakerInternalMap$com.squareup.haha.guava.collect.MapMakerInternalMap$HashIterator
Warning: com.squareup.haha.guava.collect.MapMakerInternalMap$ValueIterator: can't find referenced class com.squareup.haha.guava.collect.MapMakerInternalMap$com.squareup.haha.guava.collect.MapMakerInternalMap$HashIterator
Warning: com.squareup.haha.perflib.io.MemoryMappedFileBuffer: can't find referenced class sun.misc.Cleaner
Warning: com.squareup.haha.perflib.io.MemoryMappedFileBuffer: can't find referenced class sun.nio.ch.DirectBuffer
Warning: com.squareup.haha.perflib.io.MemoryMappedFileBuffer: can't find referenced class sun.misc.Cleaner
Warning: com.squareup.haha.perflib.io.MemoryMappedFileBuffer: can't find referenced class sun.nio.ch.DirectBuffer
Warning: com.squareup.haha.trove.THashMap$EntryView: can't find referenced class com.squareup.haha.trove.THashMap$com.squareup.haha.trove.THashMap$MapBackedView
Warning: com.squareup.haha.trove.THashMap$KeyView: can't find referenced class com.squareup.haha.trove.THashMap$com.squareup.haha.trove.THashMap$MapBackedView
Warning: com.squareup.haha.trove.THashMap$ValueView: can't find referenced class com.squareup.haha.trove.THashMap$com.squareup.haha.trove.THashMap$MapBackedView
Warning: there were 50 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions.
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Exception while processing task
Even though in my proguard.cfg:
-keep class org.eclipse.mat.** { *; }
-keep class com.squareup.leakcanary.** { *; }
-keep class com.squareup.haha.** { *; }
-keep class sun.misc.** { *; }
-keep class sun.nio.** { *; }
mmm that's strange. What happens when you turn off proguard in your app, does LeakCanary work just fine?
I have the same issue.
Adding the -dontwarn to the proguard file fix the issues but produces some warnings.
Proguard file:
-keep class org.eclipse.mat.** { *; }
-keep class com.squareup.leakcanary.** { *; }
-keep class com.squareup.haha.** { *; }
-dontwarn com.squareup.haha.guava.**
-dontwarn com.squareup.haha.perflib.**
-dontwarn com.squareup.haha.trove.**
-dontwarn com.squareup.leakcanary.**
Warnings:
AGPBI: {"kind":"simple","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
AGPBI: {"kind":"simple","text":"(com.squareup.haha.guava.base.Joiner$1) that doesn\u0027t come with an","sources":[{}]}
AGPBI: {"kind":"simple","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
AGPBI: {"kind":"simple","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
AGPBI: {"kind":"simple","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}
AGPBI: {"kind":"simple","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]}
AGPBI: {"kind":"simple","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]}
AGPBI: {"kind":"simple","text":"indicate that it is *not* an inner class.","sources":[{}]}
AGPBI: {"kind":"simple","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
AGPBI: {"kind":"simple","text":"(com.squareup.haha.guava.collect.Iterables$2) that doesn\u0027t come with an","sources":[{}]}
AGPBI: {"kind":"simple","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
AGPBI: {"kind":"simple","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
AGPBI: {"kind":"simple","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}
AGPBI: {"kind":"simple","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]}
AGPBI: {"kind":"simple","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]}
AGPBI: {"kind":"simple","text":"indicate that it is *not* an inner class.","sources":[{}]}
AGPBI: {"kind":"simple","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
AGPBI: {"kind":"simple","text":"(com.squareup.haha.guava.collect.Iterables$3) that doesn\u0027t come with an","sources":[{}]}
AGPBI: {"kind":"simple","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
AGPBI: {"kind":"simple","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
AGPBI: {"kind":"simple","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}
AGPBI: {"kind":"simple","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]}
AGPBI: {"kind":"simple","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]}
AGPBI: {"kind":"simple","text":"indicate that it is *not* an inner class.","sources":[{}]}
Probably this is unsafe.
@SandroMachado Which java version you compiled on?
@iNoles I am not compiling it, I am just importing the 1.4-SNAPSHOT using gradle.
My environment is:
Android Studio 1.3.2
Java version "1.7.0_79"
Same here.
Also as a side note, I do use retroLamda, if that's relevant.
@SandroMachado's solution worked for me as well. I don't think it is unsafe, because as long as you include -keep class com.squareup.haha.** { *; } in addition to the -dontwarn lines, the classes will be preserved. I think this is the true solution and should be added to the README.
Should be fixed by #308
What do these ProGuard fixes have to do with the Marshmallow M version? I had to do the same thing in my ProGuard config as mentioned in https://github.com/square/leakcanary/issues/265#issuecomment-142618656
@rogerhu I don't use Proguard so I have no idea if there are still issues or not. Apparently there are, see #394
Added here:
It is working fine here with the latest update. No problems with the current proguard consumer files included in the library. BTW, I am just using the proguard with my release configuration, enabling it on debug I get a lot of issues, not only from leakcanary but also from butterknife, etc etc
@rogerhu are you including any other proguard configuration? The latest version (1.4 beta 1) already includes the required proguard configuration file, so I don't need to add any other special rule at least with it enable only for the release configuration.
rechecking...i noticed leak canary actually wasn't working for me until i brought these proguard lines in...but on a new project leakcanary works fine. trying to figure out what's different
The problem happens for debug builds, not for release builds because release compiles are using com.squareup.leakcanary:leakcanary-android-no-op:1.4-SNAPSHOT.
Change your relaseCompile dependency and you will see the same problem:
dependencies {
releaseCompile 'com.squareup.leakcanary:leakcanary-android:1.4-SNAPSHOT'
}
I've updated the PR for consumer-proguard-rules.pro to ensure that the library includes these definitions by default.
Well. Same for me. Everything was fine. I don't know why this error occurs...
I'm using retro lambda & proguard. Today I suddenly got this error :(
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(com.squareup.haha.guava.base.Joiner$1) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(com.squareup.haha.guava.collect.Iterables$2) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(com.squareup.haha.guava.collect.Iterables$3) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.
I am also seeing these warnings. There are started happening when i updated to _2.0.0-beta7_ version of the Android Gradle Plugin. The warnings are shown when the transformClassesWithDexFor{Variant} task is running.
Help welcome!
We use jarjar & Proguard to embed perflib into LeakCanary. perflib depends on Guava, so Proguard allows us to shrink it down to the bare minimum. I think Proguard is a bit too agressive and removes inner classes attributes that later makes it unhappy when integrating into another app. Proguard is weird.
The warnings are there but they are not fatal. The Proguard rules set not to error on them (https://github.com/square/leakcanary/blob/master/leakcanary-android/consumer-proguard-rules.pro)
I don't think this is a blocking issue. And it should probably be opened as a separate issue.
@pyricau i am starting to think this is a ProGuard issue. I added more ProGuard rules to preserve the EnclosingMethod attribute. However when examining the ProGuarded class (javap -v Joiner$1.class), it seems the attribute is still removed. 馃槩
After reading further, -keepattributes should not be needed when not obfuscating (the manual says -keepattributes is only applicable when obfuscating. i guess because attributes are not stripped when not obfuscating). I opened a topic in ProGuard forum for clarification.
I'm running into these warnings without using Proguard. Are there any fixes to silence these for non-proguard users?
The core problem was fixed. in haha. But to propagate the fix to LeakCanary, a new version of haha must be pushed, and the dependency on haha in LeakCanary must be modified to the new version. @pyricau when do you plan to do this?
when I or @jrodbx can get to it. Sorry, I can't provide any estimate, we have a tight deadline at work.
@pyricau fair enough, thanks for the great library anyway!
My build was also just breaking without me using proguard. It worked fine for some time.
Waiting for the release ;)
Thank you guys
@jrodbx updated the haha dependency, so this is now fixed. It is available in the Sonatype Snapshot repo using leakcanary version 1.4-SNAPSHOT. Thanks guys!
oops, forgot to update this here. Thanks for taking point, @WonderCsabo!
Most helpful comment
Well. Same for me. Everything was fine. I don't know why this error occurs...
I'm using retro lambda & proguard. Today I suddenly got this error :(