Kurt Renzo Acosta
11/28/2019, 3:24 AMe: java.lang.IllegalStateException: Could not find serialized descriptor for index: -6614713790654178244 kotlinx.coroutines.internal,<root>,SharedImmutable
Konstantin Petrukhnov
11/28/2019, 6:59 AMRan
11/28/2019, 10:00 AMRan
11/28/2019, 10:02 AMMaurice Jouvet
11/28/2019, 12:54 PMCristián Arenas
11/28/2019, 3:55 PMembedBitcode
in a staticLib
?
I can do it if I output a framework
, but I can’t get it to work on a static library.Joey
11/29/2019, 7:19 AMmbonnin
11/30/2019, 10:23 AM//mpp-module-1/build.gradle
kotlin {
macosX64 {
binaries {
framework()
}
}
sourceSets {
val commonMain by getting {
dependencies {
api(project(":mpp-module-2"))
}
}
}
}
And it looks like the classes from mpp-module-2
are not exported in the .framework ? Is that expected ?Piasy
12/01/2019, 3:55 AMCounter
, provides some operations, e.g. increase
and decrease
, these operations could be called from main thread or other worker threads, but Counter
will schedule these calls into its own single threaded message queue, then change its state, e.g. the count
, it may also output its state through some callback, and the callback should be invoked on main thread.
On Android, we could using Handler or Executor to implement this pattern easily, I’m thinking if it’s possible to do it on Kotlin/Native. I want to develop a Kotlin multiplatform app and want to use this pattern in it.
I tried worker
, but everything submitted to worker must be frozen, so I can’t update Counter
’s state.
I also tried coroutine
, but on Kotlin/Native, coroutine only works for main thread, although there is a preview version supporting multi-thread coroutine, but when I try to launch a coroutine on the dispatcher created by newSingleThreadContext("test")
, it fails with “This dispatcher can be used only from a single thread test, but now in MainThread”.spierce7
12/01/2019, 4:39 AMHannes
12/01/2019, 7:31 PMFlow
. Is there any material how to get started with that? I looked into existing multiplaform libraries configs on github and copied most build.gradle
config but I get a lot of unresolved reference
errors while compiling:
library/src/commonMain/kotlin/com/freeletics/flowredux/FlowRedux.kt: (7, 32): Unresolved reference: Flow
Joey
12/02/2019, 1:38 AMJoakimForslund
12/02/2019, 1:36 PMmain
into androidMain
I've added this onto the android-library extension:
sourceSets.forEach {
val root = "src/androidMain/${it.name}"
val manifestFile = file("src/androidMain/AndroidManifest.xml")
it.setRoot(root)
it.java.setSrcDirs(fileTree("${root}/kotlin"))
it.manifest.srcFile(manifestFile)
}
which seems to at least make everything look in the right place. However, now my expect/actual
in my common starts to complain
that it can not find the actual implementation for jvm set up, which is weird, because I have not setup a target for jvm, and the implementation
it should be looking for, does exist within the androidMain
folder, but it does not look for it there, how can I change that?egorand
12/03/2019, 10:25 AMjsNodeTest
started failing with the following message:
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
I’m completely fine with the tests taking longer than 2s in this case, are there any configuration options that would allow ignoring this error?Fabio Bombardi
12/03/2019, 10:43 AMandroidMain
and androidTest
folders. Any ideas of the reason I cannot see them?Max Raskin
12/03/2019, 6:12 PMDmitri Sh
12/04/2019, 4:05 AMJoey
12/04/2019, 7:10 AMmsink
12/04/2019, 7:54 AMexpect class WeakReference<T>(instance: T) {
fun get(): T?
}
jvm:
actual typealias WeakReference<T> = java.lang.ref.WeakReference<T>
native:
actual typealias WeakReference<T> = kotlin.native.ref.WeakReference<T>
jvm works, native fails with message
"The following declaration is incompatible because upper bounds of type parameters are different:
public actual typealias WeakReference<T> = WeakReference<T>"
What it wants?Joey
12/04/2019, 8:56 AMStefMa
12/04/2019, 10:30 AMyshrsmz
12/04/2019, 10:44 AMMaurice Jouvet
12/04/2019, 2:13 PMSylvain Patenaude
12/04/2019, 4:29 PMbyte[] BitConverter.GetBytes(Int32)
will preserve the computer architecture byte order (big-endian or little-endian).
Is there some equivalent (keeping the proper byte order) to this method in Kotlin?
NOTE: It is to be used in a Kotlin multiplatform context.Sylvain Patenaude
12/04/2019, 5:53 PMexpect
/ actual
pattern?
EDIT: Looks like it's doable, but the method I want to split is not an extension method after all. So my question is rather:
Can we have only some methods of a class that are prefixed with expect
or does it have to be the full class at that point?
For instance, I would have a class where pretty much all methods would be 'common' except for a few that would need to be implemented natively.darkmoon_uk
12/05/2019, 12:18 AMian.shaun.thomas
12/05/2019, 6:16 PMAndy Gibel
12/05/2019, 9:59 PMMarc Reichelt
12/05/2019, 10:04 PMMaurice Jouvet
12/06/2019, 9:34 AMMaurice Jouvet
12/06/2019, 9:34 AMEllen Shapiro
12/06/2019, 10:49 AMMaurice Jouvet
12/06/2019, 1:16 PM