Since I have enabled Bitcode in my app, I cannot f...
# kotlin-native
m
Since I have enabled Bitcode in my app, I cannot figure out how to get a clean call stack in Crashlytics. • Kotlin 1.4 • Bitcode enabled • Dsyms downloaded from the App Store Connect (Crashlytics does not complains of missing Dsyms) • Static Framework • CrasKIos (with latest version of Crashlytics) Any hints would be appreciated: Details in 🧵
Actual stack trace 😢
Copy code
Crashed: com.apple.main-thread
0  libsystem_kernel.dylib         0x1bc958df0 __pthread_kill + 8
1  libsystem_pthread.dylib        0x1bc878948 pthread_kill + 228
2  libsystem_c.dylib              0x1bc807ba4 abort + 104
3  ProductName                    0x1046c9d70 ObjHeader::createMetaObject(TypeInfo**) + 2488
4  ProductName                    0x1046dde34 OnUnhandledException + 84604
5  ProductName                    0x1046fb328 printlnMessage(char const*) + 204656
6  ProductName                    0x104570f18 objc2kotlin.517 + 1 (<compiler-generated>:1)
7  SwiftUI                        0x1f51a4910 PrimitiveButtonStyleConfiguration.trigger() + 28
8  SwiftUI                        0x1f52950ac partial apply for PrimitiveButtonStyleConfiguration.trigger() + 24
9  SwiftUI                        0x1f54a87d0 partial apply for closure #1 in PressableGestureCallbacks.dispatch(phase:state:) + 56
Targets in build.gradle
Copy code
targets {
        final def iOSTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") ? presets.iosArm64 : presets.iosX64

        fromPreset(iOSTarget, 'ios') {
            binaries {
                framework {
                    isStatic = true

                    embedBitcode("bitcode")
                    baseName = "$trikot_framework_name"
                    export "com.mirego.trikot:trikotFoundation:$trikot_foundation_version"
                    export "com.mirego.trikot:trikotFoundation-$iosArchLibrarySuffix:$trikot_foundation_version"
                    export "com.mirego.trikot:streams:$trikot_streams_version"
                    export "com.mirego.trikot:streams-$iosArchLibrarySuffix:$trikot_streams_version"
                    export "com.mirego.trikot:analytics:$trikot_analytics_version"
                    export "com.mirego.trikot:analytics-$iosArchLibrarySuffix:$trikot_analytics_version"
                    export "com.mirego.trikot:http:$trikot_http_version"
                    export "com.mirego.trikot:http-$iosArchLibrarySuffix:$trikot_http_version"
                    export "com.mirego.trikot:kword:$trikot_kword_version"
                    export "com.mirego.trikot:kword-$iosArchLibrarySuffix:$trikot_kword_version"
                    export "com.mirego.trikot:viewmodels:$trikot_viewmodels_version"
                    export "com.mirego.trikot:viewmodels-$iosArchLibrarySuffix:$trikot_viewmodels_version"
                }
            }
        }
    }
iosPart
Copy code
iosMain {
            dependsOn commonMain
            dependencies {
                api "co.touchlab:crashkios:0.3.0"
            }
        }
Crash Handler:
Copy code
class CrashlyticsCrashHandler: CrashkiosCrashHandler {
    override func crashParts(addresses: [KotlinLong], exceptionType: String, message: String) {
        let exceptionModel = ExceptionModel(name: exceptionType, reason: message)
        exceptionModel.stackTrace = addresses.map {
            StackFrame(address: UInt(truncating: $0))
        }
        Crashlytics.crashlytics().record(exceptionModel: exceptionModel)
    }
}
And the init (in AppDelegate after
FirebaseApp.configure()
):
Copy code
CrashKIosKt.crashInit(handler: CrashlyticsCrashHandler())
Something I am missing ?