mirzemehdi / KMPNotifier

Kotlin Multiplatform Push Notification Library targetting android, iOS, Desktop and Web (JS and Wasm)
http://mirzemehdi.com/KMPNotifier/
Apache License 2.0
340 stars 19 forks source link

Koin crash: kotlin.native.internal.IrLinkageError: Can not get instance of singleton 'Companion': No class found for symbol 'kotlin.uuid/Uuid.Companion|null[0]' #81

Closed szczepanski-k closed 1 month ago

szczepanski-k commented 1 month ago

KMPNotifier and Kotlin version: kmpnotifier version: 1.3.0, kotlin version: 2.0.0

Everything works fine on kmpnotifier version: 1.2.1

Describe the bug I got exactly this crash on ios: https://github.com/InsertKoinIO/koin/issues/1985 Android works fine with the same code.

kotlin.native.internal.IrLinkageError: Can not get instance of singleton 'Companion': No class found for symbol 'kotlin.uuid/Uuid.Companion|null[0]'
Function doesn't have or inherit @Throws annotation and thus exception isn't propagated from Kotlin to Objective-C/Swift as NSError.
It is considered unexpected and unhandled instead. Program will be terminated.
Uncaught Kotlin exception:     at 0   ios staging.debug.dylib             0x10caede63        kfun:kotlin.Throwable#<init>(kotlin.String?){} + 119 
    at 1   ios staging.debug.dylib             0x10cae714b        kfun:kotlin.Error#<init>(kotlin.String?){} + 115 
    at 2   ios staging.debug.dylib             0x10cb2408b        kfun:kotlin.native.internal.IrLinkageError#<init>(kotlin.String?){} + 115 
    at 3   ios staging.debug.dylib             0x10cb24143        kfun:kotlin.native.internal#ThrowIrLinkageError(kotlin.String?){}kotlin.Nothing + 163 
    at 4   ios staging.debug.dylib             0x10cee1d13        kfun:org.koin.mp#generateId__at__org.koin.mp.KoinPlatformTools(){}kotlin.String + 63 

I've seen that v.1.3.0 uses koin 4.0 so I guess that's it https://mvnrepository.com/artifact/io.github.mirzemehdi/kmpnotifier/1.3.0 I'm using older koin 3.5.6 in the app itself.

In which platform bug occurs? ios only

To Reproduce Open app with koin + kmpnotifier version: 1.3.0

Expected behavior No crash

mirzemehdi commented 1 month ago

@szczepanski-k Using koin version 4.0.0, and kotlin version 2.0.20 should fix this issue. There should be a binary incompatibility between 3.5.6 and 4.0.0 koin versions

szczepanski-k commented 1 month ago

Ok we can close the issue for now. I'll downgrade kmpnotifier for now and try to upgrade versions later on. I'll post a comment if it worked or not