square / leakcanary

A memory leak detection library for Android.
https://square.github.io/leakcanary
Apache License 2.0
29.31k stars 3.97k forks source link

Cannot upgrade Android Gradle Plugin to 7.3.1 with newest Leak Canary 2.10 #2461

Open pkrawczykObj opened 1 year ago

pkrawczykObj commented 1 year ago

Description

After upgrading Android Gradle Plugin to 7.3.1 I receive following build error:

The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':app' -> com.squareup.leakcanary:leakcanary-deobfuscation-gradle-plugin:2.10 -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21

Steps to Reproduce

  1. Upgrade Android Gradle Plugin to 7.3.1
  2. Build app
  3. Error from description appears.

Expected behavior: Application compiles with no error.

Version Information

pyricau commented 1 year ago

The original contributor is @mzgreen, and @Goooler made a few changes over time. I mostly haven't touched this plugin so not a great person to fix. You're also welcome to contribute a fix.

Goooler commented 1 year ago

This is a warning, build passed. Might be time to upgrade Kotlin version of LC.

pyricau commented 1 year ago

Definitely plan on bumping but for LeakCanary 3, I've been sticking to the same version of Kotlin for all of LeakCanary 2.x

pyricau commented 1 year ago

but you're saying "Kotlin Gradle plugin version 1.5.20" implies "kotlin compiler 1.5" ?

Goooler commented 1 year ago

That's a check from AGP.

pkrawczykObj commented 1 year ago

This is a warning, build passed. Might be time to upgrade Kotlin version of LC.

No it is an error in my project and it unabled to compile the app. image

but you're saying "Kotlin Gradle plugin version 1.5.20" implies "kotlin compiler 1.5" ?

I mean this: https://plugins.gradle.org/plugin/org.jetbrains.kotlin.android. Currently you are using version 1.4.21 from December 2020. It is defined in line 18 in file "gradle/libs.versions.toml" (https://github.com/square/leakcanary/commit/51cdeca4e98b4c29e1e631209d8432bdd298316d#)

Goooler commented 1 year ago

Do you apply the newer KGP in you classpath? It works well in my project with KGP 1.8.0 & AGP 7.4.0, see https://github.com/Goooler/DemoApp

pyricau commented 1 year ago

Will upgrade a bunch of things for 3.0 so this will hopefully go away.