2017-04-09 21 views
1

我搜索了一个答案,并找不到任何东西,这可能意味着这是一个基本问题。冒着表现出我的无知的危险,我仍然会问。我正准备发布我的应用程序,并希望确保泄漏金丝雀不会为我的用户弹出。我的泄漏金丝雀相关的依赖关系是这样的。我应该为发布版本删除泄漏的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这意味着我可以用我的发布版本进行的是无需拆卸泄漏金丝雀代码。我对吗?

+2

AFAIK,你是对的。 – CommonsWare

回答

5

我在网上找到了。

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