Edit, added description after @JakeWharton 's feedback:
-keep class leakcanary.** { *; } which will keep all of LeakCanary.leakcanary.internal.InternalLeakCanary.INSTANCE. Ideally we can reproduce this in the sample app.# Marshmallow removed Notification.setLatestEventInfo()
-dontwarn android.app.Notification
I tried to use old rules with new package leakcanary:
-dontwarn com.squareup.haha.guava.**
-dontwarn com.squareup.haha.perflib.**
-dontwarn com.squareup.haha.trove.**
-dontwarn com.squareup.leakcanary.**
-keep class com.squareup.haha.** { *; }
-keep class com.squareup.leakcanary.** { *; }
-keep class leakcanary.** { *; }
# Marshmallow removed Notification.setLatestEventInfo()
-dontwarn android.app.Notification
But it doesn't work.
it doesn't work can mean many things :) . Can you provide more details as to what's failing? This rule didn't exist before: -keep class leakcanary.** { *; } and I actually believe that should be all you need, so if that's still failing I'm curious to know what error you're having.
If you include that rule, you might as well turn ProGuard off.
On Mon, May 20, 2019 at 1:51 PM PY notifications@github.com wrote:
it doesn't work can mean many things :) . Can you provide more details as
to what's failing? This rule didn't exist before: -keep class
leakcanary.** { *; } and I actually believe that should be all you need,
so if that's still failing I'm curious to know what error you're having.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/square/leakcanary/issues/1354?email_source=notifications&email_token=AAAQIENVZEQCIZ6AUHBFZZ3PWLQJPA5CNFSM4HODZN5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVZSXQQ#issuecomment-494087106,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAQIEMUAUZ272Y22ZVNTLTPWLQJPANCNFSM4HODZN5A
.
That's exactly what the previous rules were doing. It made ProGuard a no-op for LeakCanary, which many people are ok with as a dev tool, and I'd rather have that than crashing on missing symbols. Someone wants the better config, they can contribute it and show me how to test proguarded builds.
Since the heap dump parser was rewritten 100% of the code is in our control and I believe there's only one bit of reflection (in the next alpha, only on master) to retrieve leakcanary.internal.InternalLeakCanary.INSTANCE as a LeakSentryListener. Open to positive contributions that make that work and show me how to repro.
it doesn't workcan mean many things :) . Can you provide more details as to what's failing? This rule didn't exist before:-keep class leakcanary.** { *; }and I actually believe that should be all you need, so if that's still failing I'm curious to know what error you're having.
The build hangs in this step: Optimizing (pass 1/5)... It looks like an endless loop. I'm debugging it.
What happens if you remove all those LeakCanary rules?
I found the same issue on Okio. https://github.com/square/okio/issues/516
I'm tried to use Proguard 6.1beta2 and R8. R8 fix this problem, but I had a new problem with Moshi and Toothpick. I spent all my time debugging and I stop do it. I'll try again later.
Hi! I'm on v2.3 and having a similar issue I think (https://github.com/square/leakcanary/issues/1354#issuecomment-494124482)
Running ./gradlew testapp:assembleRelease fail because of:
Warning: leakcanary.internal.activity.screen.HeapAnalysisFailureScreen$createView$1$1$1: can't find referenced class leakcanary.internal.activity.screen.HeapAnalysisFailureScreen$createView$1$1
Warning: leakcanary.internal.activity.screen.HeapAnalysisFailureScreen$createView$1$1$1: can't find referenced class leakcanary.internal.activity.screen.HeapAnalysisFailureScreen$createView$1$1
Warning: leakcanary.internal.activity.screen.HeapDumpScreen$createView$1$1$1: can't find referenced class leakcanary.internal.activity.screen.HeapDumpScreen$createView$1$1
Warning: leakcanary.internal.activity.screen.HeapDumpScreen$createView$1$1$1: can't find referenced class leakcanary.internal.activity.screen.HeapDumpScreen$createView$1$1
Warning: leakcanary.internal.activity.screen.HeapDumpScreen$createView$1$1$signatures$1: can't find referenced class leakcanary.internal.activity.screen.HeapDumpScreen$createView$1$1
Warning: leakcanary.internal.activity.screen.HeapDumpScreen$createView$1$1$signatures$1: can't find referenced class leakcanary.internal.activity.screen.HeapDumpScreen$createView$1$1
Warning: leakcanary.internal.activity.screen.LeakScreen$createView$1$1$1: can't find referenced class leakcanary.internal.activity.screen.LeakScreen$createView$1$1
Warning: leakcanary.internal.activity.screen.LeakScreen$createView$1$1$1: can't find referenced class leakcanary.internal.activity.screen.LeakScreen$createView$1$1
Warning: leakcanary.internal.activity.screen.RenderHeapDumpScreen$createView$1$3$1$1$3: can't find referenced class leakcanary.internal.activity.screen.RenderHeapDumpScreen$createView$1$3$1$1
Warning: leakcanary.internal.activity.screen.RenderHeapDumpScreen$createView$1$3$1$1$3: can't find referenced class leakcanary.internal.activity.screen.RenderHeapDumpScreen$createView$1$3$1
Warning: leakcanary.internal.activity.screen.RenderHeapDumpScreen$createView$1$3$1$1$3: can't find referenced class leakcanary.internal.activity.screen.RenderHeapDumpScreen$createView$1$3
Warning: leakcanary.internal.activity.screen.RenderHeapDumpScreen$createView$1$3$1$1$3: can't find referenced class leakcanary.internal.activity.screen.RenderHeapDumpScreen$createView$1$3$1$1
And if I add -dontwarn leakcanary.internal.activity.screen.* to my proguard-rules.pro I get an endless proguard execution.
Optimizing (pass 1/5)...
<============-> 97% EXECUTING [49m 13s]
Disclaimer: I'm adding leakcanary dependency as implementation because since it's a demo app I want to have leakcanary both on debug/release builds.
Do you have any clue on how to fix it?
Most helpful comment
The build hangs in this step:
Optimizing (pass 1/5)...It looks like an endless loop. I'm debugging it.