I use a library named LeakCanary which allows me to find anything that cause memory leaks. I add the following references in gradle:
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.2'
To use the library. Now, before creating an APK full release for the store, do I need to comment the above lines, or is it safe to just keep them and comment only the line to use the library in the main activity.
Thanks.
release builds would only contain leakcanary-android-no-op ... where no op means "no operation"; therefore one can assume no side-effects there; except adding the size of that dummy package to the release build's package size. that no op dummy package is only required, because else any occurrence of LeakCanary in the code would be unknown.
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