net.akehurst.kotlin.kt2ts icon indicating copy to clipboard operation
net.akehurst.kotlin.kt2ts copied to clipboard

Error "INSTANCE" in 1.5.2

Open sarahBuisson opened this issue 4 years ago • 3 comments

I have this error who pop when I use the 1.5.2, 1.5.1, both with build.gradle.kts and build.gradle Edit 2: I didn't reproduce in 1.5.0

I use your plugin with the experimental gradle kotlin multiplatform plugin in version 1.3.72

  • Exception is: java.lang.NoSuchFieldError: INSTANCE at net.akehurst.kotlin.kt2ts.plugin.gradle.GeneratorPlugin.apply(GeneratorPlugin.kt:38) at net.akehurst.kotlin.kt2ts.plugin.gradle.GeneratorPlugin.apply(GeneratorPlugin.kt:30) at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:43) at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:51) at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:181) at org.gradle.api.internal.plugins.DefaultPluginManager.access$300(DefaultPluginManager.java:51) at org.gradle.api.internal.plugins.DefaultPluginManager$AddPluginBuildOperation.run(DefaultPluginManager.java:276) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)

sarahBuisson avatar Jun 01 '20 10:06 sarahBuisson

I get this error also. I think it is because there is an incompatibility with the version of kotlin used by gradle. which version of gradle are you using...and which version of kotlin is used by that version of gradle?

dhakehurst avatar Jun 02 '20 07:06 dhakehurst

I have just published version 1.5.3. I use this successfully with

> gradle --version
------------------------------------------------------------
Gradle 6.4.1
------------------------------------------------------------

Build time:   2020-05-15 19:43:40 UTC
Revision:     1a04183c502614b5c80e33d603074e0b4a2777c5

Kotlin:       1.3.71
Groovy:       2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          13.0.2 (Oracle Corporation 13.0.2+8)
OS:           Mac OS X 10.15.4 x86_64

also using kotlin("multiplatform") version("1.3.72")

basically the version of kotlin used by gradle (reported with gradle --version) has to be compatible with the version of kotlin used to build the kt2ts plugin.

kts gradle (kotlin in gradle) 1.5.0 6.0.1 (1.3.50) 1.5.2 6.3 (1.3.70) 1.5.3 6.4.1 (1.3.71)

dhakehurst avatar Jun 02 '20 07:06 dhakehurst

did this solve your issue?

dhakehurst avatar Aug 05 '20 08:08 dhakehurst