We have a <iOS library written in Kotlin> and we h...
# kotlin-native
k
We have a iOS library written in Kotlin and we have a few customers that uses it on production. On of our client is getting crash reports from users related to our library (crash report and integration code in thread). From the code and crash reports it is very hard to tell what could go wrong - the crash happens in during the initialization process of class that keeps reference to the our library’s main class. The first line from the crash report is:
Copy code
0  AudioburstMobileLibrary    	0x1035f2f0c kfun:kotlinx.coroutines#<get-mainThread>(){}kotlinx.coroutines.MainThread + 1289996 (Thread.kt:31)
However I don’t have a crash message, so I can’t be sure what might go wrong there. Is there any way to investigate this problem? Did you ever see something similar to this? The crashes are not reproducible by the client, but it affects like 70 users
s
Can one of the methods your code is calling throw an exception that you may not be handling?
k
I checked it pretty deeply and I don’t think there is such a place in the library’s code. From the crash report it looks like the root of the crash is in the
AudioManager
constructor:
Copy code
@objc AudioManager.init() + 1217892 (<compiler-generated>:0)
so it happens during
AudioManager
initialization which is also initializing my library. This is very confusing because it happens only for some users and is not reproducible
s
I use https://github.com/touchlab/CrashKiOS to get better crash reports. Are you able to use something similar?
k
Thanks for suggestion, but unfortunately I can’t see an option to hook this on the library side
s
No, it should be done by the app. Your library can contain the hooks to enable it but the app will have to call them.