Roman Vasilyev
01/04/2021, 12:39 AMmagnumrocha
01/05/2021, 6:15 PM@kotlinx.cinterop.internal.CCall public external fun SCNetworkReachabilityGetFlags(target: platform.SystemConfiguration.SCNetworkReachabilityRef? /* = kotlinx.cinterop.CPointer<cnames.structs.__SCNetworkReachability>? */, flags: kotlinx.cinterop.CValuesRef<platform.SystemConfiguration.SCNetworkReachabilityFlagsVar /* = kotlinx.cinterop.UIntVarOf<kotlin.UInt> */>?): kotlin.Boolean { /* compiled code */ }
to receive the kSCNetworkReachabilityFlags…
correctly?
in Swift, we can make the call:
var flags: SCNetworkReachabilityFlags = []
if !SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags) {
return false
}
And receive the flags in an array style….
In Kotlin Native, I am doing:
// val flags = allocArray<SCNetworkReachabilityFlagsVar>(10) // -> this was my first attempt, they are 10 possible flags!
val flags = alloc<SCNetworkReachabilityFlagsVar>()
if (!SCNetworkReachabilityGetFlags(reachabilityRef, flags.ptr)) return false
the problem is I am receiving all the flag “summed” (they are kotlin.UInt
), and not split in an array, like in Swift.mkrussel
01/05/2021, 8:36 PMAnimesh Sahu
01/06/2021, 8:50 AMStableRef
having object wrapping mutable property vs AtomicRef
? Which is better to store a mutable object not-frozen (sort of for thread isolation)?Paul Woitaschek
01/08/2021, 5:30 PMIncorrectDereferenceException
It seems I cant use kotlin native on a background thread at all. (kotlin 1.4.21 and coroutines 1.4.2-native-mt)
import platform.darwin.DISPATCH_QUEUE_PRIORITY_DEFAULT
import platform.darwin.dispatch_async
import platform.darwin.dispatch_get_global_queue
import platform.posix.sleep
import kotlin.test.Test
class PersonGenerator
class MyTest {
@Test
fun test() {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT.toLong(), 0)) {
PersonGenerator()
}
sleep(1000)
}
}
Uncaught Kotlin exception: kotlin.native.IncorrectDereferenceException: illegal attempt to access non-shared MyTest.$test$lambda-0$FUNCTION_REFERENCE$43@8ae08b08 from other thread
John O'Reilly
01/08/2021, 8:35 PMawait
and async
https://ohmyswift.com/blog/2020/12/25/experimenting-with-swift-async-and-await-pattern-using-xcode/
Are there any thoughts at this stage, for Kotlin/Native, how this could be mapped to Kotlin suspend functions?savrov
01/09/2021, 2:53 PMrunDebugExecutableNative
process? google did not give me anything so far…Kai Limadjaja
01/11/2021, 1:54 PMApp Store Connect Operation Error
ERROR ITMS-90205: "Invalid Bundle. The bundle at '<http://XXXX.app/Frameworks/XXXXMobileShared.framework|XXXX.app/Frameworks/XXXXMobileShared.framework>' contains disallowed nested bundles."
App Store Connect Operation Error
ERROR ITMS-90206: "Invalid Bundle. The bundle at '<http://XXXX.app/Frameworks/XXXXMobileShared.framework|XXXX.app/Frameworks/XXXXMobileShared.framework>' contains disallowed file 'Frameworks'."
Jérôme Gully
01/11/2021, 4:56 PMРолан
01/11/2021, 7:18 PMJérôme Gully
01/12/2021, 10:16 AMensureNeverFrozen
from common code or swift code ?
For the moment I only can access concurrent functions like freeze
and ensureNeverFrozen
in the iosMain shared code. I have an InvalidMutabilityException
calling ktor get function but I only call common code and can't use ensureNeverFrozen
in commin code to debugribesg
01/12/2021, 11:17 AM#import "BugsnagApp.h"
to something like #import <Bugsnag/BugsnagApp.h>
Error:
Exception in thread "main" java.lang.Error: /[…]/Carthage/Build/iOS/Bugsnag.framework/Headers/Bugsnag.h:28:9: fatal error: 'Bugsnag/BugsnagApp.h' file not found
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.indexDeclarations(Indexer.kt:1003)
at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:992)
at org.jetbrains.kotlin.native.interop.indexer.NativeIndexKt.buildNativeIndex(NativeIndex.kt:91)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:267)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:73)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:41)
My def file:
depends = Foundation
package = framework.Bugsnag
language = Objective-C
headers = Bugsnag.h
compilerOpts = -framework Bugsnag
linkerOpts = -framework Bugsnag
Gradle cinterop configuration:
compilations.getByName("main").cinterops.create("Bugsnag") {
defFile("src/iosMain/cinterop/Bugsnag.def")
includeDirs.allHeaders("$projectDir/Carthage/Build/iOS/Bugsnag.framework/Headers")
}
What can I do to make cinterop work with that commit’s change?spierce7
01/12/2021, 8:57 PMPaul Woitaschek
01/13/2021, 4:19 PMNiccolo Machiavelli
01/14/2021, 12:17 PMimport kotlinx.cinterop.*
not available when used inside kotlin multiplatform (either commonMain or androidMain) ?Justin
01/15/2021, 9:20 PMmacOS-arm64
frameworks (i.e. for Apple Silicon machines)?Claus Rørbech
01/18/2021, 5:08 PMUndefined symbols for architecture x86_64
in a KMM project based on https://github.com/Kotlin/kmm-sample/blob/master/README.md.
The ios framework (:shared:linkDebugFrameworkIos
) only fails to link when disabling caching with kotlin.native.cacheKind=none
(or if using Gradle composite builds for the dependencies), but works when using the cache when consuming the dependencies from a Maven repository.
The unresolved symbols are defined as custom declarations in a cinterop-wrapper’s def-file and used by static libraries in the dependent module. The klibs passed to konanc seems right and the klibs seems to contain the right symbols in the cstubs.bc
. The only difference on the konanc command line when it works (i.e. without kotlin.native.cacheKind=none
) is a couple of additional -Xcache-directory
entries, that indeed contains archives containing the symbols. I have tried getting details from the linking phase (by various `freeCompilerArgs`/ `linker-option`s) without luck. Any idea on how to get insight in the linker invocation through konanc or any known limitations/issues around linking against custom declarations in a module’s? The project is available at https://github.com/realm/realm-kotlin/tree/master/examples/kmm-sampleJeff Lockhart
01/19/2021, 7:52 AMNSNumber
Objective-C reference to a Kotlin Number
? The docs describe casting the other way, but not clear how to accomplish the reverse.Karlo Lozovina
01/21/2021, 1:47 PMivan.savytskyi
01/25/2021, 4:07 PMe: Compilation failed: org.jetbrains.kotlin.ir.declarations.impl.IrValueParameterImpl@65fe2bcd
* Source files:
* Compiler version info: Konan: 1.4.10 / Kotlin: 1.4.10
* Output kind: FRAMEWORK
e: java.lang.UnsupportedOperationException: org.jetbrains.kotlin.ir.declarations.impl.IrValueParameterImpl@65fe2bcd
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$TopLevelCodeContext.unsupported(IrToBitcode.kt:239)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$TopLevelCodeContext.genGetValue(IrToBitcode.kt:255)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$TopLevelCodeContext.genGetValue(IrToBitcode.kt:238)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$ParameterScope.genGetValue(IrToBitcode.kt:621)
Mikołaj Kąkol
01/25/2021, 4:25 PMclass AppSession internal constructor(globalScope: GlobalScope) {
private val appRepositoryFactory = globalScope.appRepositoryFactory
init {
CoroutineScope(Dispatchers.Default).launch {
withContext(Dispatchers.Default) {
appRepositoryFactory.profilesRepository
}
}
}
this is not
class AppSession internal constructor(globalScope: GlobalScope) {
init {
CoroutineScope(Dispatchers.Default).launch {
withContext(Dispatchers.Default) {
globalScope.appRepositoryFactory.profilesRepository
}
}
}
did someone had something weird? nothing is happening inside this “profilesRepository”. Without coroutines it also works. Error is:
Uncaught Kotlin exception: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen pl.app.di.AppSession@848e28
at 0 MobileBankShared 0x0000000110718fcd kfun:kotlin.Throwable#<init>(kotlin.String?){} + 93 (/Users/teamcity/buildAgent/work/cae0e6559deed4c4/runtime/src/main/kotlin/kotlin/Throwable.kt:23:37)
Nicholas Tian
01/29/2021, 12:39 AMaleksey.tomin
01/29/2021, 11:41 AM/Applications/myapp.app/Contents/MacOS/myapp.kexe
- I see blurred image (see the first image).
If I move /Applications/myapp.app
into home and run ~/myapp.app/Contents/MacOS/myapp.kexe
- I see the same.
If I rename ~/myapp.app
to ~/myapp
and run ~/myapp/Contents/MacOS/myapp.kexe
- I see ok image (see the second image)
What do I wrong? How can I fix it?napperley
01/30/2021, 4:18 AMMichal Klimczak
01/30/2021, 2:59 PMMyCoolGenericExample<T>
accessed from Swift will always have the T
nullable. Is that true or am I missing something?Todd
02/01/2021, 2:37 AMUnfinished workers detected, 1 workers leaked!
when running this code on linuxX64joshshin
02/02/2021, 6:04 PMkotlin{
targets.withType<KotlinNativeTarget> {
binaries.all {
freeCompilerArgs += "-Xadd-light-debug=enable"
}
binaries.withType<org.jetbrains.kotlin.gradle.plugin.mpp.Framework> {
isStatic = true
}
}
}
I just hooked up my app to sentry and was testing things out, I see that I uploaded the dsym files, but everything's looking like this:John O'Reilly
02/04/2021, 5:07 PMJeff Lockhart
02/05/2021, 6:02 AMByteArray
to and from CFDataRef
? I found this for converting to/from NSData
, but having a hard time figuring out how to do something similar for CFDataRef
. I need to create a SecCertificateRef
, which I’m using SecCertificateCreateWithData()
and SecCertificateCopyData()
to create and get the data from.Daniel Sapozhnikov
02/05/2021, 10:07 AMhashCode
function from my KMP project targeting jvm js and ios. The function provided by the kotlin-stdlib and kotlin-stdlib-js return the same results for a given String
, however, the function provided by the Kotlin/Native stdlib (which seems to call Any.identityHashCode()
under the covers) returns different results for the same String
. Does anyone know if this is intentional and whether there might be a way to get results from the Kotlin/Native target that are consistent with the other targets?Daniel Sapozhnikov
02/05/2021, 10:07 AMhashCode
function from my KMP project targeting jvm js and ios. The function provided by the kotlin-stdlib and kotlin-stdlib-js return the same results for a given String
, however, the function provided by the Kotlin/Native stdlib (which seems to call Any.identityHashCode()
under the covers) returns different results for the same String
. Does anyone know if this is intentional and whether there might be a way to get results from the Kotlin/Native target that are consistent with the other targets?Artyom Degtyarev [JB]
02/05/2021, 2:01 PMDaniel Sapozhnikov
02/08/2021, 5:39 PM