2017-04-09 24 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' 
}