https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
w

Wolf Logan

08/21/2020, 5:51 PM
I'm running into an internal compiler error while trying to migrate my project to Kotlin 1.4. I have a Kotlin Multiplatform project (Gradle w/Kotlin dialect) building for two targets (JS and JVM); the JVM target uses Spring Boot 2.2.6. With the project configured to use the 1.3.72 plugin, everything builds fine. Moving to the 1.4.0 plugin (and updating Kotlin library references to 1.4.0) causes the build to fail with the error below:
Copy code
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileKotlinJvm'.
> Internal compiler error. See log for more details
 . . .
/xxx/xxx/xxx.kt:57
  @PutMapping("/{userId}", consumes = [MediaType.APPLICATION_JSON_VALUE])
                                      ^
e: org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (57,39) in /xxx/xxx/xxx.kt
	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.logOrThrowException(ExpressionTypingVisitorDispatcher.java:253)
 . . .
Caused by: java.lang.NoSuchMethodError: kotlin.sequences.SequencesKt.flatMapIterable(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
	at org.jetbrains.kotlin.resolve.calls.components.CollectionTypeVariableUsagesInfo.getDependentTypeParameters(ResolutionParts.kt:364)
r

Robert Jaros

08/21/2020, 6:22 PM
try adding
extra["kotlin.version"] = "1.4.0"
to your
build.gradle.kts
.
at least it lets me run spring boot 2.3.3 app with 1.4.0
w

Wolf Logan

08/24/2020, 6:53 PM
Magic! Thanks very much. Is there documentation anywhere regarding how that value is used?
w

Wolf Logan

08/24/2020, 7:58 PM
perfect, thanks!
11 Views