Fanis Paschos
02/11/2021, 2:19 PMJack Darlington
02/11/2021, 3:01 PMe: 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 buildFrancis Mariano
02/11/2021, 6:01 PMclass DeviceScanPresenter(
private val bluetoothRepository: BluetoothRepositoryKmm
) : BasePresenter<DeviceScanView>() {
private val mainScope = MainScope()
private var scan: Job? = null
.......
fun deviceScanDevice() {
view?.log("presenter - deviceScanDevice444")
view?.showCancelButton()
view?.clearDevices()
view?.log("presenter - deviceScanDevice:beforeOfLaunch")
scan = mainScope.launch(start = CoroutineStart.UNDISPATCHED) {
view?.log("presenter - deviceScanDevice:launch")
try {
view?.log("presenter - deviceScanDevice:try")
withTimeout(20000) {
view?.log("presenter - deviceScanDevice:withTimeout:withTimeout")
view?.log("presenter - deviceScanDevice:withTimeout:bluetoothRepository = $bluetoothRepository")
bluetoothRepository.devices.collect {
view?.log("presenter - deviceScanDevice:withTimeout:collect")
view?.showDevice(it)
}
}
} catch (e: TimeoutCancellationException) {
view?.log("presenter - deviceScanDevice:catch : ${e.message}")
view?.showUpdateButton()
}
}.apply {
invokeOnCompletion {
bluetoothRepository.stopScanLeDevice()
view?.log("presenter - deviceScanDevice444:invokeOnCompletation")
}
}
view?.log("presenter - deviceScanDevice:startScanLeDevice")
bluetoothRepository.startScanLeDevice()
}
.....
}
BluetoothRepositoryKmm
object BluetoothRepositoryKmmImpl : BluetoothRepositoryKmm {
....
private var repositoryScope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
....
private val _devices = MutableSharedFlow<Device>()
override val devices = _devices.asSharedFlow()
....
override fun startScanLeDevice() {
println("BluetoothRepositoryKmmImpl - startScanLeDevice333")
scanJob = repositoryScope.launch {
println("BluetoothRepositoryKmmImpl - startScanLeDevice:launch")
Scanner().advertisements.collect {
println("BluetoothRepositoryKmmImpl - startScanLeDevice:collect")
val ret = _devices.tryEmit(it.devicePlatformFrom())
println("BluetoothRepositoryKmmImpl - startScanLeDevice:collect:ret = $ret")
}
}.apply { invokeOnCompletion { println("BluetoothRepositoryKmmImpl - startScanLeDevice:invokeOnCompletation") } }
}
....
}
dasralph
02/12/2021, 11:17 AMBenoît
02/12/2021, 12:38 PMe: Compilation failed: Backend Internal error: Exception during IR lowering
File being compiled: /Users/benoit/dev/project/business-logic/src/commonMain/kotlin/com/project/business_logic/BusinessLogicModule.kt
The root cause java.lang.IllegalArgumentException was thrown at: org.jetbrains.kotlin.backend.common.lower.SingleAbstractMethodLowering.createObjectProxy(SingleAbstractMethodLowering.kt:393)
* Source files:
* Compiler version info: Konan: 1.4.30 / Kotlin: 1.4.30
* Output kind: FRAMEWORK
e: org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: /Users/benoit/dev/project/business-logic/src/commonMain/kotlin/com/project/business_logic/BusinessLogicModule.kt
The root cause java.lang.IllegalArgumentException was thrown at: org.jetbrains.kotlin.backend.common.lower.SingleAbstractMethodLowering.createObjectProxy(SingleAbstractMethodLowering.kt:393)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:239)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException$default(CodegenUtil.kt:235)
...
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Sequence contains more than one matching element.
at org.jetbrains.kotlin.backend.common.lower.SingleAbstractMethodLowering.createObjectProxy(SingleAbstractMethodLowering.kt:393)
at org.jetbrains.kotlin.backend.common.lower.SingleAbstractMethodLowering.visitTypeOperator(SingleAbstractMethodLowering.kt:122)
at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitTypeOperator(IrElementTransformerVoid.kt:245)
Any idea ?Paul Woitaschek
02/12/2021, 3:13 PM.gradlew publish
.
I tried to disable all publish tasks that contain watchos but it still builds the targetskpgalligan
02/14/2021, 3:16 PMcompile[source set name]MainKotlinMetadata
. If there isn't an obvious issue and setting I should apply that somebody knows offhand, I'll post a simple example a bit later. I'm thinking if I could just set something that tells gradle to ignore non-native hosts, and config CI to also build with a linux host, I might be able to move forward (CI currently runs mac and windows builds). Thoughts?Abhishek Dewan
02/15/2021, 6:24 AMAlex Anisimov
02/15/2021, 9:33 AMgammax
02/15/2021, 10:39 AMmavenCentral
and using the maven-publish
plugin (no 3rd parties)? If yes don’t you mind linking 🙏aiidziis
02/15/2021, 12:47 PMpod ‘MobileEngine, :path => ‘../MobileEngine’
, but we would like to version our library and distribute it to private repository. Haven’t found any useful blog/article/repository.Ivan Fedyanin
02/15/2021, 2:05 PMbmo
02/15/2021, 3:26 PM> Task :module:podGenIOS SKIPPED
> Task :module:podSetupBuildPodDependencyIphonesimulator SKIPPED
I suspend this is linked to me not being able to see the dependencies.
Is there a way for me to force Kotlin to generate the bridge (or at least let IntelliJ know about it) so that I can develop for iOS in Kotlin MPP without actually buying a Mac ?Amritansh
02/15/2021, 4:04 PMUnresolved reference: newSingleThreadContext
. The project builds and run fine if I use Android studio or xcode to run the app.
These are all the dependencies which I am using
object Versions {
const val MIN_SDK = 23
const val COMPILE_SDK = 30
const val TARGET_SDK = 30
const val kotlin = "1.4.20"
const val androidTools = "4.1.1"
const val coroutines = "1.3.9-native-mt-2"
const val serialization = "1.0.1"
const val ktor = "1.4.3"
const val klock = "2.0.0"
const val benasherUUID = "0.2.3"
const val stately = "1.1.0"
const val junit = "4.12"
const val sqlDelight = "1.4.3"
}
object Dependencies {
const val kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
const val kotlinSerialization = "org.jetbrains.kotlin:kotlin-serialization:${Versions.kotlin}"
const val androidTools = "com.android.tools.build:gradle:${Versions.androidTools}"
const val coroutinesCore =
"org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.coroutines}"
const val kotlinxSerialization =
"org.jetbrains.kotlinx:kotlinx-serialization-core:${Versions.serialization}"
const val ktorClientCore = "io.ktor:ktor-client-core:${Versions.ktor}"
const val ktorClientSerialization = "io.ktor:ktor-client-serialization:${Versions.ktor}"
const val ktorClientAndroid = "io.ktor:ktor-client-android:${Versions.ktor}"
const val ktorClientIos = "io.ktor:ktor-client-ios:${Versions.ktor}"
const val klock = "com.soywiz.korlibs.klock:klock:${Versions.klock}"
const val benasherUUID = "com.benasher44:uuid:${Versions.benasherUUID}"
const val stately = "co.touchlab:stately-concurrency:${Versions.stately}"
const val junit = "junit:junit:${Versions.junit}"
const val sqlDelightGradlePlugin =
"com.squareup.sqldelight:gradle-plugin:${Versions.sqlDelight}"
const val sqlDelightCommon = "com.squareup.sqldelight:runtime:${Versions.sqlDelight}"
const val sqlDelightAndroid =
"com.squareup.sqldelight:android-driver:${Versions.sqlDelight}"
const val sqlDelightIOS =
"com.squareup.sqldelight:native-driver:${Versions.sqlDelight}"
}
Abhishek Dewan
02/16/2021, 6:26 AMimport org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
kotlin("multiplatform")
id("com.android.library")
id("kotlinx-serialization")
}
kotlin {
android()
ios {
binaries {
framework {
baseName = "shared"
isStatic = false
export(Deps.kermit)
transitiveExport = true
}
}
}
sourceSets {
all {
languageSettings.apply {
useExperimentalAnnotation("kotlin.RequiresOptIn")
useExperimentalAnnotation("kotlinx.coroutines.ExperimentalCoroutinesApi")
}
}
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
implementation(Deps.Ktor.commonCore)
implementation(Deps.Ktor.commonJson)
implementation(Deps.Ktor.commonLogging)
implementation(Deps.Coroutines.common) {
version {
strictly(Versions.coroutines)
}
}
implementation(Deps.multiplatformSettings)
implementation(Deps.koinCore)
implementation(Deps.Ktor.commonSerialization)
implementation(Deps.kotlinxDateTime)
api(Deps.kermit)
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val androidMain by getting {
dependencies {
implementation("com.google.android.material:material:1.2.1")
}
}
val androidTest by getting {
dependencies {
implementation(kotlin("test-junit"))
implementation("junit:junit:4.13")
}
}
val iosMain by getting {
dependencies {
implementation(Deps.Ktor.ios)
}
}
val iosTest by getting
}
}
android {
compileSdkVersion(29)
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdkVersion(24)
targetSdkVersion(29)
}
}
val packForXcode by tasks.creating(Sync::class) {
group = "build"
val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
val sdkName = System.getenv("SDK_NAME") ?: "iphonesimulator"
val targetName = "ios" + if (sdkName.startsWith("iphoneos")) "Arm64" else "X64"
val framework = kotlin.targets.getByName<KotlinNativeTarget>(targetName).binaries.getFramework(mode)
inputs.property("mode", mode)
dependsOn(framework.linkTask)
val targetDir = File(buildDir, "xcode-frameworks")
from({ framework.outputDirectory })
into(targetDir)
}
tasks.getByName("build").dependsOn(packForXcode)
Jawid
02/16/2021, 1:25 PMmbonnin
02/16/2021, 4:45 PMExecution failed for task 'publishKotlinMultiplatformPublicationToMavenLocal'.
> Failed to publish publication 'kotlinMultiplatform' to repository 'mavenLocal'
> Invalid publication 'kotlinMultiplatform': multiple artifacts with the identical extension and classifier ('jar', 'sources').
Does that ring any bell?Ben Lancaster
02/16/2021, 4:51 PMfromPreset
for our use case. Can anyone give me a steer on what I should be using instead? Example in the thread:Dean Djermanović
02/16/2021, 4:54 PMFrancis Mariano
02/16/2021, 6:49 PMrobstoll
02/16/2021, 7:30 PMsynchronized
will go away from common (Synchronization on any object is not supported on every platform and will be removed from the common standard library soon.
). Is there another locking mechanism available?Neal Sanche
02/16/2021, 10:00 PMAbhishek Dewan
02/17/2021, 1:06 AMSlackbot
02/17/2021, 6:44 PMDaniele B
02/18/2021, 6:06 PMSLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See <http://www.slf4j.org/codes.html#StaticLoggerBinder> for further details.
Patrick Ramsey
02/18/2021, 8:17 PMMustafa Ozhan
02/18/2021, 9:09 PMNeal Sanche
02/18/2021, 9:20 PMiosX64test
target on a project where the test (only one test, as a proof of concept) previously passed. After adding a second KMP module (to work around a conflict between two gradle plugins), the ios tests now hang indefinitely with what looks like a gradle daemon connection issue. Thing is, the second module doesn't contain any tests, it is just code generation. Now the tests just repeat the following over and over:
2021-02-18T14:17:06.271-0700 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2021-02-18T14:17:06.271-0700 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2021-02-18T14:17:06.271-0700 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
The way that I included the second KMP module was using a dependency entry:
commonMainApi(project(":shared-rest"))
I'm not sure what I should try to get the tests to finish as expected. Any ideas?Denis Ismailaj
02/18/2021, 11:49 PMVinod Rai
02/19/2021, 6:56 AMVinod Rai
02/19/2021, 6:56 AMMustafa Ozhan
02/19/2021, 8:16 AMINSERT INTO
commands like here
https://github.com/CurrencyConverterCalculator/CCC/blob/master/common/src/commonMain/database/com/github/mustafaozhan/ccc/common/sql/Currency.sqVinod Rai
02/19/2021, 11:43 AMMustafa Ozhan
02/19/2021, 12:43 PM