Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LeakCanary should crash in release builds #1804

Closed
pyricau opened this issue Apr 23, 2020 · 1 comment · Fixed by #1806
Closed

LeakCanary should crash in release builds #1804

pyricau opened this issue Apr 23, 2020 · 1 comment · Fixed by #1806

Comments

@pyricau
Copy link
Member

pyricau commented Apr 23, 2020

Sometimes developers ship LeakCanary in release builds by accident, their users see the LeakCanary icon and get really confused.

We should introduce a new default behavior where if the leakcanary-core-android artifact ships in a non debuggable app, LeakCanary automatically crashes on app startup. This will make it much more likely that the issue is detected early.

The check should rely on InternalAppWatcher.isDebuggableBuild and should be implemented in InternalLeakCanary invoke's function which is invoked on app startup. We should add an XML boolean attribute that allows overriding of this behavior. The exception error message should explain what's happening and mention the boolean XML attribute.

@pyricau
Copy link
Member Author

pyricau commented Apr 23, 2020

This is another way to solve what #1793 is trying to solve, at runtime instead of via Lint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant