We have the following working line of build script running on Gradle 5.2.1:
version = object {
val value : String by lazy {
VersionBuilderPlugin.versionFromGitTag()
}
override fun toString() : String = value
}
On attempting to run the build on Gradle 6.1.1, we get an error:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/tester/Documents/gradle-plugins-common/build.gradle.kts' line: 18
* What went wrong:
'void Build_gradle$1.<init>(Build_gradle)'
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
java.lang.NoSuchMethodError: 'void Build_gradle$1.<init>(Build_gradle)'
at Build_gradle.<init>(build.gradle.kts:18)
at Program.execute(Unknown Source)
What changed here, and what’s the fix?