---
updatedAt: 2026-02-12T13:35:59.000Z
agentTools:
  projectIndex: https://docs.emergetools.com/llms.txt
---

# Leak Canary enabled on production (Android)

[LeakCanary](https://square.github.io/leakcanary/) is a memory leak detection library for Android. Given that it adds instrumentation to your code, it's recommended to include it only on debug.\
This insight detects if you have enabled Leak Canary in production.

In order to correctly setup LeakCanary, declare the dependency as **debugImplementation** on your app’s build.gradle\[.kts] file:

```kotlin
dependencies {
  // debugImplementation because LeakCanary should only run in debug builds.
  debugImplementation("com.squareup.leakcanary:leakcanary-android:X.Y.Z")
}
```
```groovy
dependencies {
  // debugImplementation because LeakCanary should only run in debug builds.
  debugImplementation 'com.squareup.leakcanary:leakcanary-android:X.Y.Z'
}
```

> 📘 LeakCanary for releases
>
> LeakCanary has also support for [release builds](https://square.github.io/leakcanary/leakcanary-for-releases/) in production. Emerge doesn't display any insight if your app is using that feature.