saket
09/14/2020, 6:43 PMexpensivebelly
09/15/2020, 8:41 AMDaniele B
09/15/2020, 3:15 PMclass Repository {
companion object Data {
var lastUpdate: String? = null
var countriesListWithSummary: List<CountrySummary> = emptyList()
}
}
when I compile it for iOS, I get these warnings:
Variable in singleton without @ThreadLocal can't be changed after initialization
and on runtime I actually get this crash:
kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen mypackage.Repository.Data@3310e88
How should I handle this situation?Elka
09/16/2020, 8:30 AM// In Constant.kt
val x: Int = 0
fun doSomething(): String
Daniele B
09/16/2020, 5:10 PMStateFlow
on Kotlin/Native.
Let’s say StateFlow is holding/passing an immutable data object, and it’s collected on the iOS side on Dispatchers.Main
, to be used with SwiftUI.
On the Application Logic side, I’m processing/setting the new StateFlow values (by using the Kotlin copy
function), inside a coroutine.
My question is:
according to the current Kotlin/Native multithreading system, should such coroutine where I am processing/setting the new StateFlow values run on Dispatchers.Main
or it can also use a background thread (e.g. Dispatchers.Default)?
Being the value immutable, I wonder if StateFlow
is able to provide thread safety under the hood, without having to care what is the thread where the new value is set.alex_vinz
09/17/2020, 8:49 AMUndefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FIROptions", referenced from:
objc-class-ref in shared(result.o)
"_OBJC_CLASS_$_FIRApp", referenced from:
objc-class-ref in shared(result.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Martin Gagnon
09/17/2020, 1:21 PMDaniele B
09/17/2020, 2:19 PMld: warning: ignoring file myApp/shared/build/xcode-frameworks/shared.framework/shared, building for iOS Simulator-arm64 but attempting to link with file built for iOS Simulator-x86_64
Diego
09/17/2020, 2:22 PMiosArm64
and iosX64
. I have configured them to generate a .framework
with the following code:
iosArm64() {
binaries {
framework {
baseName = "KiplingCommonArm64"
}
}
}
iosX64() {
binaries {
framework {
baseName = "KiplingCommonX64"
}
}
}
Like with any other third party iOS framework, I would like to have a single one that can run in the simulator and the real devices. Is that possible? If so, how can I do it?ribesg
09/17/2020, 3:23 PMdazza5000
09/17/2020, 6:24 PMApplication Specific Backtrace 1:
0 CoreFoundation 0x00007fff23e3de6e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff512a19b2 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23e5eb94 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff23e4286c ___forwarding___ + 1436
4 CoreFoundation 0x00007fff23e44b58 _CF_forwarding_prep_0 + 120
5 FivestarsPay 0x000000010be83ae7 $s12FivestarsPay0aB8ListenerC02onaB5Event09fivestarsbE0ySo06SharedabE0C_tF + 1655
6 FivestarsPay 0x000000010be83cc4 $s12FivestarsPay0aB8ListenerC02onaB5Event09fivestarsbE0ySo06SharedabE0C_tFTo + 68
7 shared 0x000000010beed242 objc2kotlin.278 + 802
8 shared 0x000000010bed2c48 kfun:fivestars.okpayplugin.OkPayPlugin#handleAction(com.fivestars.integration.okpayplugin.model.Action;kotlin.String?;kotlin.String?){} + 3688
9 shared 0x000000010bed14b7 kfun:fivestars.Plugin.object-1.userContentController#internal + 1495
10 shared 0x000000010bed19dc _496e746567726174696f6e3a706f696e746f6673616c65_knbridge20 + 300
11 WebKit 0x00007fff2d44f4b1 _ZN28ScriptMessageHandlerDelegate14didPostMessageERN6WebKit12WebPageProxyEONS0_13FrameInfoDataERN7WebCore21SerializedScriptValueE + 217
12 WebKit 0x00007fff2d5febf3 _ZN6WebKit29WebUserContentControllerProxy14didPostMessageERN3IPC10ConnectionEN3WTF16ObjectIdentifierINS_26WebPageProxyIdentifierTypeEEEONS_13FrameInfoDataEyRKNS1_13DataReferenceE + 175
13 WebKit 0x00007fff2d809f16 _ZN6WebKit29WebUserContentControllerProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE + 146
14 WebKit 0x00007fff2d2bae6a _ZN3IPC18MessageReceiverMap15dispatchMessageERNS_10ConnectionERNS_7DecoderE + 114
15 WebKit 0x00007fff2d53599a _ZN6WebKit15WebProcessProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE + 24
16 WebKit 0x00007fff2d2a993c _ZN3IPC10Connection15dispatchMessageENSt3__110unique_ptrINS_7DecoderENS1_14default_deleteIS3_EEEE + 158
17 WebKit 0x00007fff2d2a8f71 _ZN3IPC10Connection24dispatchIncomingMessagesEv + 377
18 JavaScriptCore 0x00007fff26aaaa15 _ZN3WTF7RunLoop11performWorkEv + 549
19 JavaScriptCore 0x00007fff26aaab82 _ZN3WTF7RunLoop11performWorkEPv + 34
20 CoreFoundation 0x00007fff23da1c91 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
21 CoreFoundation 0x00007fff23da1bbc __CFRunLoopDoSource0 + 76
22 CoreFoundation 0x00007fff23da1394 __CFRunLoopDoSources0 + 180
23 CoreFoundation 0x00007fff23d9bf8e __CFRunLoopRun + 974
24 CoreFoundation 0x00007fff23d9b8a4 CFRunLoopRunSpecific + 404
25 GraphicsServices 0x00007fff38c05bbe GSEventRunModal + 139
26 UIKitCore 0x00007fff49372964 UIApplicationMain + 1605
27 FivestarsPayHyperloop 0x000000010b81eb25 main + 1173
28 libdyld.dylib 0x00007fff5211c1fd start + 1
29 ??? 0x0000000000000001 0x0 + 1
natario1
09/18/2020, 4:53 PMX
depends on project(":Y")
and on some cinterop libraries. Because of how cinterop tasks are configured by the Kotlin plugin, anytime Y
changes, all the interops are executed again, slowing down the build.napperley
09/20/2020, 9:13 PMSourabh Rawat
09/21/2020, 3:05 AMC:\Users\srawa\.konan\dependencies\msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1\bin\ld: cannot find -lcurl
I installed libcurl following https://github.com/JetBrains/kotlin-native/blob/master/samples/libcurl/README.md. Not sure what the problem is.Kroppeb
09/22/2020, 12:48 PMKroppeb
09/22/2020, 1:30 PM<KONAN_DATA_DIR or user dir>/.konan/dependencies/msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1/bin/windres
But I have no idea what's supposed to be thereEvaS
09/22/2020, 3:31 PMkotlin.native.internal
with Kotlin 1.4 ? It says "unresolved reference" but I see a lot of message mentioning it. Did it change ?eenriquelopez
09/23/2020, 9:23 AMJames Smith
09/23/2020, 10:43 AMxcodebuild failed with error 65
. If I try to add the @objc wrapper directly to the pod in question, the build fails with Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$__TtC11CryptoSwift9CryptoAES", referenced from:
objc-class-ref in result.o
Which references exactly the wrapper that I created. What am I missing?Nikky
09/23/2020, 11:33 AMalex_vinz
09/24/2020, 3:25 PMJames Smith
09/25/2020, 12:12 PMdyld: Library not loaded: @rpath/MyFramework.framework/MyFrameworkMyFramework
Referenced from: /redacted/path/build/bin/ios/debugTest/test.kexe
Reason: image not found
My gradle setup is exactly as in the article, there are no warnings from the linker.
I've checked several resources about xcode problems like this, tried settings from these answers:
https://stackoverflow.com/questions/27174371/ios-8-dynamic-framework-library-not-loaded
https://stackoverflow.com/questions/45542928/load-custom-dynamic-library-dylib-in-ios-applicationArnaud Vallat
09/26/2020, 5:30 PMRoger Kreienbühl
09/27/2020, 1:46 PMsigHandler: Unhandled signal 11, terminating
My code looks like this:
package ch.lichtwellenreiter.omrr
import kotlinx.cinterop.staticCFunction
import pigpio.*
const val GPIO_BUTTON = 6
var lastChange: UInt = 0u
fun main() {
initGPIO()
setupButton()
while (true) {}
}
private fun initGPIO() {
if (gpioInitialise() < 0) {
println("GPIO Error initialising")
return
}
}
private fun setupButton() {
val buttonPort = GPIO_BUTTON.toUInt()
initPortWithMode(buttonPort, PI_INPUT)
gpioSetAlertFunc(buttonPort, flankChangeDetected)
}
private fun initPortWithMode(port: UInt, mode: Int) {
if (gpioSetMode(port, mode.toUInt()) < 0) {
println("Could not set mode for GPIO$port")
return
}
}
val flankChangeDetected = staticCFunction<Int, Int, UInt, Unit> { gpio, level, tick ->
val ticker = tick
val pin = gpio
val lvl = level
when (lvl) {
0 -> {
val time = ticker - lastChange
lastChange = ticker
println(tick)
if ((time > 55u && time < 61u) || (time > 113u && time < 119u)) println(time)
println("Button Pressed down, level 0")
}
1 -> {
val time = ticker - lastChange
lastChange = ticker
println(tick)
if ((time > 55u && time < 61u) || (time > 113u && time < 119u)) println(time)
println("Button released, level 1")
}
2 -> println("Button GPIO timeout, no level change")
}
}
The error occurs not every time, I could not identify the exact place in code where it happens, but I think it is the access to lastChange
inside the when expression.
Has anyone some experience with such errors?
Is there a way to copy the value from a C Int or UInt?SrSouza
09/27/2020, 11:10 PMmyrronth
09/28/2020, 4:47 AMSam Garfinkel
09/28/2020, 5:04 PMMartin Gagnon
09/28/2020, 9:28 PMcancellableManager.cancel()
that cancel and frees a list of object.
• The list inside the cancellableManager
is replaced by a frozen new list (Stored inside an AtomicReference)
• Assert happens
I would really like some support from @cschramm here 😉 In any case, I’ll continue trying to understand this issue.
Could it be possible that the GC can be triggered by the common code and simultaneously by Swift ? (Common Code triggers the GC -> this has an impact on the swift Code, swift code triggers the GC)?ribesg
09/29/2020, 9:52 AMMemory.cpp
. Looks like every time I relaunch my app it ends up crashing in a different place after a few seconds. It’s a big app, no way I can make a reproducer for these errors.ribesg
09/29/2020, 1:58 PMribesg
09/29/2020, 1:58 PMsvyatoslav.scherbina
10/07/2020, 12:43 PMribesg
10/07/2020, 12:47 PM