Marc Knaup
06/10/2019, 10:26 PMMarc Knaup
06/11/2019, 2:58 PMMarc Knaup
06/11/2019, 4:06 PMprivate object CurrentQueueDispatcher : CoroutineDispatcher() {
override fun dispatch(context: CoroutineContext, block: Runnable) {
dispatch_async(dispatch_get_current_queue()) {
block.run()
}
}
}
…
GlobalScope.launch(CurrentQueueDispatcher) { … }
Also, dispatch_async
or dispatch_sync
? The documentation doesn't state whether it's okay to block here or not.EnricCamarero
06/12/2019, 8:32 AMJonas Bark
06/12/2019, 8:42 AMdyld: Library not loaded: @rpath/Redacted.framework/Redacted
Referenced from: /var/containers/Bundle/Application/89E8B214-46AC-4251-B0EE-25222E57D0F7/konfswift.app/konfswift
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/89E8B214-46AC-4251-B0EE-25222E57D0F7/konfswift.app/Frameworks/Redacted.framework/Redacted: no matching architecture in universal wrapper
The gradle task used:
tasks.create("debugFatFramework", FatFrameworkTask::class) {
baseName = "Redacted"
from(
iosArm32.binaries.getFramework("DEBUG"),
iosArm64.binaries.getFramework("DEBUG"),
//iosX64.binaries.getFramework("DEBUG")
)
destinationDir = File(buildDir, "build")
group = "Universal framework"
description = "Builds a universal (fat) debug framework"
}
Andy Victors
06/12/2019, 11:37 AM'swift_name' attribute has invalid identifier for base name
for all autogenerated `serializer()`classes. (Kotlin: 1.3.31
, Serialization: 0.11.0
) Should I worry about it?tylerwilson
06/12/2019, 1:53 PMtylerwilson
06/12/2019, 2:51 PMAndrey Makovskiy
06/12/2019, 8:35 PMBhattachar
06/12/2019, 9:17 PMEnricCamarero
06/13/2019, 10:49 AMExtension with name 'android' does not exist. Currently registered extension names: [ext, kotlin, defaultArtifacts, reporting, sourceSets, java]`
build.gradle
plugins {
kotlin("multiplatform") version "1.3.31"
}
kotlin {
android()
}
Fail
06/13/2019, 12:56 PMFail
06/13/2019, 3:45 PMiosMain {
dependencies {
implementation "io.ktor:ktor-client-ios:$ktor_version"
}
}
But it not compiling.
Error:
> Task :app:linkDebugFrameworkIos
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_UIDevice", referenced from:
objc-class-ref in combined.o
ld: symbol(s) not found for architecture x86_64
e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
> Task :app:linkDebugFrameworkIos FAILED
Andrei Marshalov
06/14/2019, 11:07 AMsomeFunctionFromC(data: kotlinx.cinterop.CValuesRef<libmylib.GByteVar /* = kotlinx.cinterop.UByteVarOf<libmylib.GByte /* = kotlin.UByte */> */>?)
So, i tried to use ‘cstr’ how it described here (https://kotlinlang.org/docs/tutorials/native/mapping-strings-from-c.html):
val kotlinString = "qwerty"
someFunctionFromC(kotlinString.cstr)
but i get type mismatch:
Type mismatch:
Required : CValuesRef<GByteVar /* = UByteVarOf<GByte /* = UByte */> */>?
Found : CValues<ByteVar /* = ByteVarOf<Byte /*>
So i need to pass in C function not const char* cstring
, but const unsigned char* cstring
Solution that i found (https://github.com/JetBrains/kotlin-native/blob/master/INTEROP.md):
kotlinString.toUtf8().toUByteArray().usePinned { kString ->
someFunctionFromC(kString.adressOf(0))
}
It work, but doesn’t look well. Maybe someone can suggest a better way?Fudge
06/14/2019, 12:15 PMjvmMain
code.Kruger Brent
06/14/2019, 3:21 PMmbonnin
06/14/2019, 6:07 PMByteArray
to a kolinx.io.core.Input
? I'm mainly interested by the `readByte()`/`readInt()` methods so it should be doable by hand but would prefer not reinventing the wheel if possible.cafonsomota
06/14/2019, 7:14 PM- src/androidMain
- src/iOSMain
- src/jsMainand my app/build.gradle follows the same approach, having all these modules on the dependencies:
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
...
}
}
androidMain...
iOSMain...
jsMain...
at this moment I’ve managed to compile the project both for android and iOS and my js module is capable to access to commonMain (shared code).
However, it seems that I’m unable to compile the JavaScript itself 😕.
Any idea what I could be doing wrong?louiscad
06/15/2019, 2:02 PM1.8.4-jetbrains-5
of the bintray gradle plugin instead of the jfrog official 1.8.4 version. Why so? Didn't found any sources for it, nor any documentation regarding it…Jurriaan Mous
06/16/2019, 11:37 AMpublic interface Options<T extends Options>
It uses T
to return self so it can chain method calls.
I want to make this interface available to multiplatform with expect/actual so I can also expose the implementing classes with Options interface with expect/actual through a typealias.
The actual: actual typealias Options<T> = AliasedOptions<T>
If I put expect interface Options<T: Options<*>>
the actual succeeds but expect fails with Violation of Finite Bound Restriction for Options
If I put expect interface Options<T: Options<T>>
the expect succeeds but the actual fails with
Actual typealias 'DBOptionsInterface' has no corresponding expected declaration
The following declaration is incompatible because upper bounds of type parameters are different:
public expect interface Options<T : Options<T> /* = Options<T> */>
I have no control over the java library. Are there options to work around this?
Or is my only option to copy all the expected methods to all implementing classes and ignore the interfaces?nestserau
06/17/2019, 10:41 AMPatrick Jackson
06/17/2019, 3:06 PMBenjamin Charais
06/17/2019, 8:43 PMEXC_BAD_ACCESS (code=1, address=0x8)
in reference to ktor_mutex_create
My versions and implementations:
top build.gradle
buildscript {
ext.kotlin_version = '1.3.31'
ext.coroutines_version = '1.2.1'
ext.klockVersion = "1.4.0"
ext.serialization_version = "0.10.0"
ext.ktor_version = '1.1.4'
ext.dokka_version = '0.9.17'
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:$dokka_version"
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04'
classpath "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version"
}
common build.gradle
iOSMain.dependencies {
api kotlin('stdlib')
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version"
implementation "io.ktor:ktor-client-ios:$ktor_version"
implementation "io.ktor:ktor-client-json-native:$ktor_version"
implementation "io.ktor:ktor-client-logging-native:$ktor_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serialization_version"
}
The last reference it talks about is
kfun:kotlinx.cinterop.<get-rawValue>@kotlinx.cinterop.CPointer<#STAR>?.()ValueType at Types.kt
this is in reference to utils.ktor_mutex_create
msink
06/18/2019, 9:03 AMJan Stoltman
06/18/2019, 10:33 AMAndrei Marshalov
06/18/2019, 11:35 AMspierce7
06/19/2019, 10:02 PMFail
06/20/2019, 8:50 AMJurriaan Mous
06/20/2019, 9:06 AMEnricCamarero
06/20/2019, 10:41 AM__attribute__((swift_name("Repository")))
@protocol DomainRepository
@required
- (DomainResult *)getDataSync __attribute__((swift_name("getDataSync()")));
@end;
interface Repository {
suspend fun getData(): Result<List<Song>>
fun getDataSync() : Result<List<Song>>
}
EnricCamarero
06/20/2019, 10:41 AM__attribute__((swift_name("Repository")))
@protocol DomainRepository
@required
- (DomainResult *)getDataSync __attribute__((swift_name("getDataSync()")));
@end;
interface Repository {
suspend fun getData(): Result<List<Song>>
fun getDataSync() : Result<List<Song>>
}
marstran
06/20/2019, 10:42 AMEnricCamarero
06/20/2019, 10:43 AMkpgalligan
06/20/2019, 10:45 AMribesg
06/20/2019, 10:59 AMlouiscad
06/20/2019, 11:48 AM