From 1b2683714238da34084f16f206404c6ceede9ded Mon Sep 17 00:00:00 2001 From: machiav3lli Date: Fri, 19 Jul 2024 09:33:00 +0200 Subject: [PATCH] Add: LeakCanary to debug memory leaks --- build.gradle.kts | 1 + gradle/libs.versions.toml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 6396e75aff..b7c6a42f94 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -125,6 +125,7 @@ dependencies { implementation(libs.preference) implementation(libs.activity.compose) implementation(libs.collections.immutable) + debugImplementation(libs.leakcanary) // use the new WorkInfo.stopReason (report stopReason), setNextScheduleTimeOverride (Precise scheduling), Configuration.Builder.setContentUriTriggerWorkersLimit (limit for content uri workers) implementation(libs.work.runtime) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fb5db29be9..caa1ce7a11 100755 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,6 +14,7 @@ koin-ksp = "1.3.1" kotlin = "2.0.0" ksp = "2.0.0-1.0.23" ktor = "2.3.12" +leakcanary = "2.14" libsu = "5.2.2" lifecycle = "2.8.3" markdown = "0.7.3" @@ -30,6 +31,7 @@ zxing = "3.5.3" [libraries] kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } ksp = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" } +leakcanary = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanary" } preference = { module = "androidx.preference:preference-ktx", version.ref = "preference" } activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity" } collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "immutables" }