leakcanary icon indicating copy to clipboard operation
leakcanary copied to clipboard

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

Open pkrawczykObj opened this issue 2 years ago • 8 comments

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

  • LeakCanary version: 2.10
  • Android OS version: n/a
  • Gradle version: 7.3.1

pkrawczykObj avatar Jan 09 '23 15:01 pkrawczykObj

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.

pyricau avatar Jan 23 '23 23:01 pyricau

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

Goooler avatar Jan 24 '23 00:01 Goooler

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 avatar Jan 24 '23 00:01 pyricau

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

pyricau avatar Jan 24 '23 00:01 pyricau

That's a check from AGP.

Goooler avatar Jan 24 '23 01:01 Goooler

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#)

pkrawczykObj avatar Jan 24 '23 07:01 pkrawczykObj

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

Goooler avatar Jan 24 '23 07:01 Goooler

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

pyricau avatar May 18 '23 04:05 pyricau