I searched for an answer to this and couldn't find anything, which probably means it's a basic question. At the risk of showing my ignorance, I'm going to ask anyway. I am preparing my app for release and want to insure Leak Canary doesn't popup for my users. My leak canary related dependencies are as such.
dependencies {
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
}
I think that since the releaseCompile contains no-op
it means I can proceed with my release build as is without removing the Leak Canary code. Am I right?
I found this online.
dependencies {
// Real LeakCanary for debug builds only: notifications, analysis, etc
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
// No-Op version of LeakCanary for release builds: no notifications, no analysis, nothing
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
}
The answers are correct but there's an updated and easier solution as of 4/13/19:
dependencies {
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-3'
}
no need for no-ops nor proguard.
but why?
ok but how?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With