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

Jack Darlington

02/11/2021, 3:01 PM
Hi, I get a compiler error for compileKotlinIosX64:
Copy code
e: Compilation failed: An operation is not implemented: Not yet implemented

 * Source files: MutableStateFlow.kt, FormattedStringFactory.kt, VideoUtils.kt, RevolutionData.kt, RoutineViewModelDto.kt, ExerciseState.kt, RevolutionData.kt, Routine.kt, AndroidSerialization.kt, SerializationExtension.kt, Image.kt, SocketEvents.kt, FormattedStringFactory.kt, Parcelable.kt, Image.kt, MutableStateFlow.kt
 * Compiler version info: Konan: 1.4.21 / Kotlin: 1.4.21
 * Output kind: LIBRARY

e: kotlin.NotImplementedError: An operation is not implemented: Not yet implemented
	at org.jetbrains.kotlin.backend.konan.serialization.KonanIrLinker.getTranslationPluginContext(KonanIrlinker.kt:94)
	at org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.tryResolveCustomDeclaration(KotlinIrLinker.kt:546)
	at org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.getDeclaration(KotlinIrLinker.kt:566)
	at org.jetbrains.kotlin.ir.util.ExternalDependenciesGeneratorKt.getDeclaration(ExternalDependenciesGenerator.kt:60)
	at org.jetbrains.kotlin.ir.util.ExternalDependenciesGenerator.generateUnboundSymbolsAsDependencies(ExternalDependenciesGenerator.kt:50)
	at org.jetbrains.kotlin.psi2ir.generators.ModuleGenerator.generateUnboundSymbolsAsDependencies(ModuleGenerator.kt:62)
	at org.jetbrains.kotlin.psi2ir.Psi2IrTranslator.generateModuleFragment(Psi2IrTranslator.kt:89)
	at org.jetbrains.kotlin.backend.konan.PsiToIrKt.psiToIr(PsiToIr.kt:126)
	at org.jetbrains.kotlin.backend.konan.ToplevelPhasesKt$psiToIrPhase$1.invoke(ToplevelPhases.kt:134)
	at org.jetbrains.kotlin.backend.konan.ToplevelPhasesKt$psiToIrPhase$1.invoke(ToplevelPhases.kt)
	at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$namedOpUnitPhase$1.invoke(PhaseBuilders.kt:97)
	at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$namedOpUnitPhase$1.invoke(PhaseBuilders.kt:95)
	at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:94)
	at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:30)
	at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:94)
	at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:41)
	at org.jetbrains.kotlin.backend.konan.KonanDriverKt.runTopLevelPhases(KonanDriver.kt:29)
	at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:78)
....

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':base:compileKotlinIosX64'.
> Compilation finished with errors
I looked online trying to find the sourcecode for Kotlin Native, and I can't even find that method it is crashing on. So if anyone has any ideas would really help me out? I have a relatively simple module I have just created, and for whatever reason it wont build
m

Michal Klimczak

02/11/2021, 3:19 PM
It's a long shot, but there's some mention of KotlinIrLinker in the stack trace. Aren't you using the new IR Kotlin backend which is in beta, maybe?
j

Jack Darlington

02/11/2021, 3:27 PM
The issue came about because I wasn't using common coroutines, but just for JS, Android and iOS. I had included "org.jetbrains.kotlinxkotlinx coroutines core1.4.2-native-mt" for each platform, but I had to change iOS to be core-native-1.3.8
Actually, back to the drawing board: -
Copy code
w: Skipping "/Users/jack/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-iosarm64/1.3.8/ab1f410af27e33b328b0e7b3b75875953822e9eb/kotlinx-coroutines-core.klib" as it is a pre 1.4 library
e: Could not find "/Users/jack/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-iosarm64/1.3.8/ab1f410af27e33b328b0e7b3b75875953822e9eb/kotlinx-coroutines-core.klib" in [/Users/jack/Documents/dev/pibike/kotlin-shared/base, /Users/jack/.konan/klib, /Users/jack/.konan/kotlin-native-prebuilt-macos-1.4.21/klib/common, /Users/jack/.konan/kotlin-native-prebuilt-macos-1.4.21/klib/platform/ios_arm64].
So it isn't actually compiling now :)
And I am using version 1.4.21 of kotlin
Figured it out, the problem is when I use suspend functions as an expected function for some reason
😲 1
Assumedly, it is because they aren't supported on all native platforms ( and I am also compiling it for Arm32 which doesn't currently support them). Why that affects MacOS I don't know
2 Views