Hi! When iOS framework is distributed with “CocoaPods dependency manager” and a crash is happening i...
p
Hi! When iOS framework is distributed with “CocoaPods dependency manager” and a crash is happening in Kotlin code, the stack trace is missing the location of the crash in the source code (line number, character number) On the other hand, when building KMM app as a regular framework, this info is printed Example
(/Users/par/code/my/github/kmm_cocoa/MyApplicationwithframework/shared/src/iosMain/kotlin/com/example/myapplicationwithframework/Platform.kt:10:15)
at 5   shared                              0x000000010b99e05d kfun:com.example.myapplicationwithframework.Platform#<init>(){} + 1181 (/Users/par/code/my/github/kmm_cocoa/MyApplicationwithframework/shared/src/iosMain/kotlin/com/example/myapplicationwithframework/Platform.kt:6:35)
at 6   shared                              0x000000010b99dacd kfun:com.example.myapplicationwithframework.Greeting#greeting(){}kotlin.String + 413 (/Users/par/code/my/github/kmm_cocoa/MyApplicationwithframework/shared/src/commonMain/kotlin/com/example/myapplicationwithframework/Greeting.kt:5:26)
I know that debug information is located inside .dsym files, but I have no idea how to fix the issue. Doesn’t CocopoaPods distribution support crash debugging yet? EDIT Stack trace from a CocoaPods distributed app
Uncaught Kotlin exception: kotlin.IllegalStateException: fruit expired
at 0   iosApp                              0x00000001013e9131 kfun:kotlin.Throwable#<init>(kotlin.String?){} + 97
at 1   iosApp                              0x00000001013e397d kfun:kotlin.Exception#<init>(kotlin.String?){} + 93
at 2   iosApp                              0x00000001013e3a7d kfun:kotlin.RuntimeException#<init>(kotlin.String?){} + 93
at 3   iosApp                              0x00000001013e3dad kfun:kotlin.IllegalStateException#<init>(kotlin.String?){} + 93
at 4   iosApp                              0x00000001013d8302 kfun:com.example.myapplication.Platform#fruit(){}kotlin.String + 146
at 5   iosApp                              0x00000001013d7f53 kfun:com.example.myapplication.Platform#<init>(){} + 1587
k
There are a lot of variables in play here. Where is this stack trace coming from? Is "CocoaPods dependency manager" a remote deploy or using a local cocoapods build? Debug/release build? Static vs dynamic framework? I'd guess it's less "cocoapods" so much as how the framework is included.
p
Hey, Kevin! Thanks for getting back! I’ve created both projects with Android Studio wizard. The only modification was throwing the exception. 1. I throw an IllegalStateException from Kotlin code in both projects manually. 2. I have chosen “CocoaPods dependency manager” on the second page of KMM Application wizard. 3. Debug build. 4. Static framework.