Could not get unknown property 'destinationDir'

2.1k Views Asked by At

When I upgrade the kotlin-gradle-plugin version from 1.5.0 to 1.7.20 in Android plugin project, I got this exception.

I use this code in build.gradle

compileGroovy.classpath += files(compileKotlin.destinationDir)

How can I solve it?

My evn is:

  • gradle: 7.4
  • android-gradle: 7.3.0
  • kotlin-gradle-plugin: 1.7.20
1

There are 1 best solutions below

0
On BEST ANSWER

I found the replacement function.

compileKotlin.destinationDirectory.get()

so the question can use this code to resolve.

compileGroovy.classpath += files(compileKotlin.destinationDirectory.get())