android - 我应该为发布版本删除泄漏的金丝雀代码/类吗?

标签 android memory-leaks release leakcanary

我搜索了这个问题的答案,但没有找到任何答案,这可能意味着这是一个基本问题。冒着显示我无知的风险,我还是要问。我正在准备发布我的应用程序,并希望确保 Leak Canary 不会为我的用户弹出。我的泄漏金丝雀相关依赖项就是这样。

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'
}

我认为,由于 releaseCompile 包含 no-op,这意味着我可以按原样继续我的发布构建,而无需删除 Leak Canary 代码。我说得对吗?

最佳答案

这是我在网上找到的。

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'
}

关于android - 我应该为发布版本删除泄漏的金丝雀代码/类吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43310444/

相关文章:

android - AlertDialog 中的样式单选按钮和文本

java - 任务集上的 DefaultTaskContainer#NamedDomainObjectProvider.configure(Action) 无法在当前上下文中执行

swift - 小小的内存泄漏有多大影响?

c - 没有内存泄漏

jQuery悬停 - 按钮保持悬停效果

maven - "You don' 在 react 器项目列表中没有 SNAPSHOT 项目。”使用 Jenkins Maven 发布插件时

android - Android中Mysql连接ListView的教程

默认时区的Android解析时间

c# - 编译的表达式树会泄漏吗?

sql - 使用 Azure DevOps 的 Multi-Tenancy 数据库部署