mirzemehdi / KMPNotifier

Kotlin Multiplatform Push Notification Library targetting android and iOS
http://mirzemehdi.com/KMPNotifier/
Apache License 2.0
172 stars 10 forks source link

KMPNotifier 1.0.0 crashes the app on iOS #36

Open maicol07 opened 3 weeks ago

maicol07 commented 3 weeks ago

Hi, I get the following error when running the app on iOS after upgrading to 1.0.0 (doesn't happen with 0.6.0):

Uncaught Kotlin exception: kotlin.native.internal.IrLinkageError: Function 'koinApplication' can not be called: No function found for symbol 'org.koin.dsl/koinApplication|koinApplication(kotlin.Function1<org.koin.core.KoinApplication,kotlin.Unit>?){}[0]'
    at 0   PrepsoilApp                         0x10a8e4339        kfun:kotlin.Throwable#<init>(kotlin.String?){} + 105 
    at 1   PrepsoilApp                         0x10a8df345        kfun:kotlin.Error#<init>(kotlin.String?){} + 101 
    at 2   PrepsoilApp                         0x10a91e255        kfun:kotlin.native.internal.IrLinkageError#<init>(kotlin.String?){} + 101 
    at 3   PrepsoilApp                         0x10a91e1d8        kfun:kotlin.native.internal#ThrowIrLinkageError(kotlin.String?){}kotlin.Nothing + 168 
    at 4   PrepsoilApp                         0x10c3a14f9        kfun:com.mmk.kmpnotifier.di.LibDependencyInitializer#initialize(com.mmk.kmpnotifier.notification.configuration.NotificationPlatformConfiguration){} + 473 
    at 5   PrepsoilApp                         0x10c3a2e4e        kfun:com.mmk.kmpnotifier.notification.NotifierManagerImpl#initialize(com.mmk.kmpnotifier.notification.configuration.NotificationPlatformConfiguration){} + 174 
    at 6   PrepsoilApp                         0x10c3a27be        kfun:com.mmk.kmpnotifier.notification.NotifierManager#initialize(com.mmk.kmpnotifier.notification.configuration.NotificationPlatformConfiguration){} + 174 
    at 7   PrepsoilApp                         0x10ccbaa59        objc2kotlin_kfun:com.mmk.kmpnotifier.notification.NotifierManager#initialize(com.mmk.kmpnotifier.notification.configuration.NotificationPlatformConfiguration){} + 201 
    at 8   PrepsoilApp                         0x10a8c16ce        $s11PrepsoilApp0B8DelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtF + 174 (/Users/maicol07/Documents/prepsoil-app/iosApp/iosApp/iOSApp.swift:12:30)
    at 9   PrepsoilApp                         0x10a8c1916        $s11PrepsoilApp0B8DelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtFTo + 182 
    at 10  SwiftUI                             0x7ffa150c5ac7     get_witness_table 7SwiftUI4ViewRzlAA15ModifiedContentVyxAA30_EnvironmentKeyWritingModifierVySbSgGGAaBHPxAaBHD1__AhA0cI0HPyHCHCTm + 20221 
    at 11  SwiftUI                             0x7ffa150c5b72     get_witness_table 7SwiftUI4ViewRzlAA15ModifiedContentVyxAA30_EnvironmentKeyWritingModifierVySbSgGGAaBHPxAaBHD1__AhA0cI0HPyHCHCTm + 20392 
    at 12  UIKitCore                           0x7ff805cbc5ba     -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 296 
    at 13  UIKitCore                           0x7ff805cbe31f     -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 4252 
    at 14  UIKitCore                           0x7ff805cc3ea2     -[UIApplication _runWithMainScene:transitionContext:completion:] + 1240 
    at 15  UIKitCore                           0x7ff804fe269b     -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 180 
    at 16  UIKitCore                           0x7ff805cc06f7     -[UIApplication _compellApplicationLaunchToCompleteUnconditionally] + 58 
    at 17  UIKitCore                           0x7ff805cc0aac     -[UIApplication _run] + 935 
    at 18  UIKitCore                           0x7ff805cc5550     UIApplicationMain + 122 
    at 19  SwiftUI                             0x7ffa159e5f0e     objectdestroy.44Tm + 2709 
    at 20  SwiftUI                             0x7ffa159e5dcb     objectdestroy.44Tm + 2386 
    at 21  SwiftUI                             0x7ffa15611f34     get_witness_table 7SwiftUI4ViewRzlAA15ModifiedContentVyxAA30_EnvironmentKeyWritingModifierVySbGGAaBHPxAaBHD1__AgA0cI0HPyHCHCTm + 218 
    at 22  PrepsoilApp                         0x10a8c20f2        $s11PrepsoilApp6iOSAppV5$mainyyFZ + 34 
    at 23  PrepsoilApp                         0x10a8c2178        main + 8 (/Users/maicol07/Documents/prepsoil-app/iosApp/iosApp/iOSApp.swift:<unknown>)
    at 24  dyld                                0x1129183df        0x0 + 4606493663 
    at 25  ???                                 0x11fbc0365        0x0 + 4827382629 
mirzemehdi commented 3 weeks ago

@maicol07 Do you use koin DI in your project? Please increase koin version to 3.5.6 and see if the problem is solved

maicol07 commented 3 weeks ago

@mirzemehdi yes I use Koin but it is already upgraded to 3.5.6...

mirzemehdi commented 3 weeks ago

@maicol07 And kotlin version which version you are using?

maicol07 commented 3 weeks ago

@maicol07 And kotlin version which version you are using?

2.0.0

mirzemehdi commented 3 weeks ago

Maybe clean and rebuild again to see if it works. I can't replicate the issue

mirzemehdi commented 3 weeks ago

@maicol07 Another thing that you can try ./gradlew sharedApp:dependencies and search for koin-core, and see if other libraries that you are using uses koin version 3.5.6

maicol07 commented 3 weeks ago

@maicol07 Another thing that you can try ./gradlew sharedApp:dependencies and search for koin-core, and see if other libraries that you are using uses koin version 3.5.6

The only one who is using a different version is precompose-koin (koin-core 3.6.0-alpha03)

mirzemehdi commented 3 weeks ago

I believe this caused the problem probably

mirzemehdi commented 3 weeks ago

Or maybe because Precompose doesn't support kotlin version 2.0.0. For now I think it is better to use 0.6.0 version of KMPNotifier until issues are fixed