Lucas Schiavini
03/28/2022, 8:26 PMLucas Schiavini
03/28/2022, 8:27 PMnikhil kumar
03/29/2022, 11:02 AMVladimir Malykhin
03/30/2022, 10:12 AMTask :commonModule:linkDebugFrameworkIosArm64 FAILEDe: Compilation failed: Symbol for kotlin.time/Duration.toComponents|2397542651005564009[0] is unbound Has anyone ever met with such a thing?
rsetkus
03/30/2022, 3:14 PMSQLCipher
but getting error.
Exception in thread "main" java.lang.Error: /var/folders/z3/gtgsk6493gz1yqt86nzbgnyh0000gn/T/17166564073649352201.m:1:9: fatal error: could not build module 'SQLCipher'
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':xxx:cinteropSQLCipherIosX64'.
Any ideas how to fix this?Akram Bensalem
03/30/2022, 10:58 PMvishal G
03/31/2022, 5:53 AMRaymond Chan
04/01/2022, 10:19 AM* What went wrong:
A problem occurred configuring project ':ninegag-shared-lib'.
> Could not create task ':ninegag-shared-lib:lint'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/distiller/project/under9-shared-kmm/local.properties'
Is it possible to bypass this :lint
task creation?
And also there is an interesting part, ./gradlew
execution failed with above error for the first run, where it tries to download Gradle wrapper. Once the ~/.gradle
cache is created, if I call ./gradlew
again, it success without the above error. It only happens when gradlew
is being downloaded for the first time.afonso
04/01/2022, 1:41 PMMigratorService
in iosMain
, including all the necessary platform-specific models. I had to implement these models because I wanted to take this opportunity to revisit all the existing models and improve their structure which makes the native models not match 1-1 with the new ones.
But now I’m at a crossroads since I have no way to call the MigratorService
from commonMain
. So I either:
• Move all the code I’ve done in iosMain
to commonMain
. This has the potential risk of exposing old iOS related code to Android and the potential scenario where an Android app might try to run the migration. It also makes code ergonomics a bit more complicated, since I have a User
common model and an old User
iOS model.
• Create an expect MigratorService
in commonMain, with the actual implementation being on iosMain
. But this approach implies also adding a complete no-op
version of MigratorService
in androidMain
. Which is exposing an API that doesn’t really do what is expected.
Which one would be considered the best practice in KMM and why? Or is there another alternative to tackle these situations?grahamborland
04/01/2022, 5:06 PMSlackbot
04/02/2022, 11:11 AMvishal G
04/02/2022, 11:19 AMDragos Rachieru
04/04/2022, 11:44 AMLucas Schiavini
04/04/2022, 3:24 PMRobert Jaros
04/05/2022, 5:04 AMcompileKotlinMetadata
or metadataMainClasses
gradle tasks don't work anymore (don't try to compile common
sources or even create a build
directory). What has changed?Michael Bichlmeier
04/05/2022, 6:48 AMlocal.properties
inside my common code base? I need credentials (each dev has its own) to send an REST request.
I did in local.properties:
username=myName
password=myPassword
I have no idea how I can access them, in my code. In my build.gradle
I can do something like that:
val userName: String = gradleLocalProperties(rootDir).getProperty("username")
val password: String = gradleLocalProperties(rootDir).getProperty("password")
But how can I connect the gradle variables into my code?
Do I miss some imports or something similar?Anton Lakotka [JB]
04/05/2022, 9:00 AMJose Garcia
04/05/2022, 10:38 AM1.6.20-M1
release. When we run ./gradlew assemble
on our machines, everything works fine. However, when we run it on our CI we get the following log.
Our CI is using gradle:jdk-11
docker image which is linux-aarc64 based. Does anyone know what's going on? It seems that 1.6.20-M1
can't be used on non macOS systems? If so, is there a way to use 1.6.20-M1
and 1.6.20
simultaneously?Andrew O Hart
04/05/2022, 10:43 AMalec
04/05/2022, 3:05 PMcompileCommonMainKotlinMetadata
task, like theres no source set for metadata. The metadata stuff always confuses me, wondering if anyone has seen this too and knows whats up. It's only happening in the 1.6.20 upgrade and my suspicion is it has to do with HMPP but I'm not sureRachel Carandang
04/05/2022, 3:17 PM// in Kotlin Multiplatform library
DeviceSource {
override fun start() {
testDevices
.onEach { list ->
list.devices.forEach { addKnownDevice(it) }
}
.launchIn(Dispatchers.Main)
}
Exception:
at 0 test 0x10c51f388 kfun:kotlin.Throwable#<init>(kotlin.String?){} + 88
at 1 test 0x10c519286 kfun:kotlin.Exception#<init>(kotlin.String?){} + 86
at 2 test 0x10c519476 kfun:kotlin.RuntimeException#<init>(kotlin.String?){} + 86
at 3 test 0x10c5199c6 kfun:kotlin.IllegalStateException#<init>(kotlin.String?){} + 86
at 4 test 0x10c6aab54 kfun:kotlinx.coroutines.takeEventLoop#internal + 388
at 5 test 0x10c6aad03 kfun:kotlinx.coroutines.OldDefaultExecutor#dispatch(kotlin.coroutines.CoroutineContext;kotlinx.coroutines.Runnable){} + 179
at 6 test 0x10c6ab211 kfun:kotlinx.coroutines.OldMainDispatcher#dispatch(kotlin.coroutines.CoroutineContext;kotlinx.coroutines.Runnable){} + 241
at 7 test 0x10c68e783 kfun:kotlinx.coroutines.internal#resumeCancellableWith__at__kotlin.coroutines.Continuation<0:0>(kotlin.Result<0:0>;kotlin.Function1<kotlin.Throwable,kotlin.Unit>?){0§<kotlin.Any?>} + 1091
at 8 test 0x10c69e37b kfun:kotlinx.coroutines.intrinsics#startCoroutineCancellable__at__kotlin.coroutines.SuspendFunction1<0:0,0:1>(0:0;kotlin.coroutines.Continuation<0:1>;kotlin.Function1<kotlin.Throwable,kotlin.Unit>?){0§<kotlin.Any?>;1§<kotlin.Any?>} + 603
at 9 test 0x10c69e57d kfun:kotlinx.coroutines.intrinsics#startCoroutineCancellable$default__at__kotlin.coroutines.SuspendFunction1<0:0,0:1>(0:0;kotlin.coroutines.Continuation<0:1>;kotlin.Function1<kotlin.Throwable,kotlin.Unit>?;kotlin.Int){0§<kotlin.Any?>;1§<kotlin.Any?>} + 333
at 10 test 0x10c624883 kfun:kotlinx.coroutines.CoroutineStart#invoke(kotlin.coroutines.SuspendFunction1<0:0,0:1>;0:0;kotlin.coroutines.Continuation<0:1>){0§<kotlin.Any?>;1§<kotlin.Any?>} + 323
at 11 test 0x10c613edc kfun:kotlinx.coroutines.AbstractCoroutine#start(kotlinx.coroutines.CoroutineStart;0:0;kotlin.coroutines.SuspendFunction1<0:0,1:0>){0§<kotlin.Any?>} + 156
at 12 test 0x10c614139 kfun:kotlinx.coroutines#launch__at__kotlinx.coroutines.CoroutineScope(kotlin.coroutines.CoroutineContext;kotlinx.coroutines.CoroutineStart;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,kotlin.Unit>){}kotlinx.coroutines.Job + 585
at 13 test 0x10c614452 kfun:kotlinx.coroutines#launch$default__at__kotlinx.coroutines.CoroutineScope(kotlin.coroutines.CoroutineContext?;kotlinx.coroutines.CoroutineStart?;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,kotlin.Unit>;kotlin.Int){}kotlinx.coroutines.Job + 626
at 14 test 0x10c688823 kfun:kotlinx.coroutines.flow#launchIn__at__kotlinx.coroutines.flow.Flow<0:0>(kotlinx.coroutines.CoroutineScope){0§<kotlin.Any?>}kotlinx.coroutines.Job + 275
at 15 test 0x10c45672b kfun:com.testlabs.testshared.device.DeviceSourceImpl#start(){} + 539
at 16 test 0x10c4e206b objc2kotlin.1302 + 139
at 17 test 0x10c2940cf $s8test19MultiplatformConfigO5startyyFZ + 95 (/Users/rachelcarandang/dev/test/Config/MultiplatformConfig.swift:48:42)
at 18 test 0x10c0999ff $s8test9AppConfigO5startyyFZ + 47 (/Users/rachelcarandang/dev/test/Config/AppConfig.swift:46:29)
at 19 test 0x10c2c5941 $s8test11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtF + 1057 (/Users/rachelcarandang/dev/test/test/AppDelegate.swift:40:19)
at 20 test 0x10c2c6096 $s8test11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtFTo + 182
at 21 UIKitCore 0x7fff25055f2e -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 215
at 22 UIKitCore 0x7fff25057b9e -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 4114
at 23 UIKitCore 0x7fff2505d50d -[UIApplication _runWithMainScene:transitionContext:completion:] + 1220
at 24 UIKitCore 0x7fff245d9c79 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 121
Tarek Salama
04/05/2022, 9:07 PM./gradlew createSwiftPackage
Adam S
04/06/2022, 8:05 AMprintln(...)
?
I'm writing unit tests using Knit, and I want to verify the output is the same on as many platforms as possible. Ideally at least JS and JVM. Here's one of the tests.
Kotest has captureStandardOut(...)
, but it's JVM onlyclhols
04/06/2022, 10:03 AMRuslan Iusupov
04/06/2022, 11:00 AMdomain_facade
framework, but links MyDomainLogic
. For the test project as expected creates MyDomainLogic
framework and links MyDomainLogic
. My current workaround is just setting cocoapods.name
and framework.baseName
to domain_facade
.
Also in the main project I get strange runtime exception kotlin.ClassCastException: kotlin.String cannot be cast to kotlin.String
. It happens in co.touchlab.sqliter.DatabaseFileContext.kt
on line 39 https://github.com/touchlab/SQLiter/blob/286784f503f414efd88679362ddac47222b7110f/sqliter-driver/src/appleMain/kotlin/co/touchlab/sqliter/DatabaseFileContext.kt#L39
Again in the test project works without problems.
Do you have any ideas?Anthony Martin
04/06/2022, 3:36 PMAnthony Martin
04/06/2022, 3:37 PMiamsteveholmes
04/06/2022, 4:05 PMunresolved reference
problems in Android Studio or Intellij for Kotlin 1.6.20? I filed a seemingly related issue months ago that was never resolved and it appears to be happening by default in 1.6.20.
https://youtrack.jetbrains.com/issue/KT-48148
EDIT: This appears to have been an issue with my settings. I had to install a new intellij without importing settings. I’m working with support to pinpoint the issue.Jurriaan Mous
04/06/2022, 7:44 PMdarwinMain
shared sourceSet and platform specific cinterop implementations. It all works well to run macosArm64Test
tasks and succeeds with all building and tests. But as soon I want to publish my library it wants to run compileDarwinMainKotlinMetadata
it fails with the following exception failing to find cinterop based code which is only present in specific implementations:
> Task :compileDarwinMainKotlinMetadata FAILED
e: /Users/jurmous/space/rocksdb-multiplatform/src/appleMain/kotlin/maryk/rocksdb/AbstractComparator.kt: (5, 8): Unresolved reference: rocksdb
The build.gradle.kts setup I use:
https://github.com/marykdb/rocksdb-multiplatform/blob/master/build.gradle.kts
Project can be checked out and build but macOS is needed.
What am I missing so publishing completes successfully? And is publishing the metadata of that shared darwinMain sourceSet needed?xxfast
04/07/2022, 3:35 AM// commonMain
expect class Pager
// androidMain
actual typealias Pager = PagerState
Feels weird that you can expect a class and have it actualised by a type aliasxxfast
04/07/2022, 3:35 AM// commonMain
expect class Pager
// androidMain
actual typealias Pager = PagerState
Feels weird that you can expect a class and have it actualised by a type aliasAnton Lakotka [JB]
04/07/2022, 6:57 AM// commonMain.kt
expect class Pager
fun foo(pager: Pager) { println(pager) }
// androidMain.kt
actual typealias Pager = PagerState
When compilation for android is requested through ./gradlew build
for example.
Kotlin compiler will receive as input both source files. roughly like this: kotlinc src/commonMain.kt src/androidMain.kt
Compiler will scan all files and will try to match all expects and actuals. And if its all right, it internally makes your code look like this:
// internal representation
fun foo(pager: Pager) { println(pager) }
typealias Pager = PagerState
this is perfectly valid code.
Hope this helps you to understand the logic behind expect/actual.xxfast
04/21/2022, 5:00 AM