Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on production app #69

Open
shatodj opened this issue Apr 15, 2024 · 27 comments
Open

Crash on production app #69

shatodj opened this issue Apr 15, 2024 · 27 comments
Assignees

Comments

@shatodj
Copy link

shatodj commented Apr 15, 2024

Hi Touchlab,

I tried to implement CrashKiOS for our project and was successful when the app was built for development on iOS. In the production environment, there was a crash immediately after the app started.

Here is the error I picked up from the Console.

Scene FBSceneManager/sceneID:<APPBUNDLE>-default update failed: <NSError: 0x283a1ddd0; domain: FBSceneErrorDomain; code: 1 ("operation-failed"); "Scene update failed."> {
    NSUnderlyingError = <NSError: 0x283a1cba0; domain: FBWorkspaceScene; code: 1; "Client process exited.">;
}
COSMCtrl _foregroundAppActivity incoming bundle <APPBUNDLE>  has nil supplied UUID, finds existing 6C105A4A-1D15-36F9-8818-5CA6E2CAA5B8

Here is my gradle.build.kts for xcode:

import xx.android.bld.dependencies.LibsCommon
import xx.android.bld.dependencies.ModulesCommon
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

plugins {
    kotlin(xx.android.bld.dependencies.PluginsCommon.Kotlin.multiplatform)
    id(xx.android.bld.dependencies.PluginsCommon.CrashkiOS.id) version xx.android.bld.dependencies.VersionsCommon.crashkios // HERE
}

kotlin {
    //select iOS target platform depending on the Xcode environment variables
    val iOSTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget =
        if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true)
            ::iosArm64
        else
            ::iosX64

    iOSTarget("ios") {

        binaries {
            framework {
                baseName = "xxcommon"
                export(project(ModulesCommon.domain))
                export(project(ModulesCommon.repositories))
                export(project(ModulesCommon.data))
                export(project(ModulesCommon.appServices))
                export(LibsCommon.Multiplatform.Kodein.erased)
                //export(Libs.Multiplatform.Ktor.Client.Features.common)
            }
        }

    sourceSets {
        all {
            languageSettings.optIn("kotlin.Experimental")
            languageSettings.optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
            languageSettings.optIn("kotlinx.coroutines.FlowPreview")
            languageSettings.optIn("kotlinx.serialization.InternalSerializationApi")
            //languageSettings.optIn("kotlinx.serialization.UnstableDefault")

            languageSettings.enableLanguageFeature("InlineClasses")
        }

        val commonMain by getting {
            dependencies {
                implementation(LibsCommon.Kotlin.stdLibCommon)
                implementation(LibsCommon.Multiplatform.Kodein.erased)
                //implementation(Libs.Multiplatform.Ktor.Client.Features.common)
                api(project(ModulesCommon.infrastructure))
                api(project(ModulesCommon.domain))
                api(project(ModulesCommon.repositories))
                api(project(ModulesCommon.data))
                api(project(ModulesCommon.appServices))
            }
        }

        val iosMain by getting {
            dependencies {
                implementation(project(ModulesCommon.infrastructure))
                implementation(LibsCommon.Multiplatform.Logging.Napier.ios)
                implementation(LibsCommon.Multiplatform.SQLDelight.Driver.ios)
                implementation(LibsCommon.Crashkios.lib) // HERE
            }
        }
    }

    /*   sourceSets["commonMain"].dependencies {
           implementation(Libs.Kotlin.stdLibCommon)
           api(project(Modules.domain))
           api(project(Modules.repositories))
           api(project(Modules.data))
       } */

}

val packForXcode by tasks.creating(Sync::class) {
    val targetDir = File(buildDir, "xcode-frameworks")

    /// selecting the right configuration for the iOS
    /// framework depending on the environment
    /// variables set by Xcode build
    val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
    val framework = kotlin.targets
        .getByName<KotlinNativeTarget>("ios")
        .binaries.getFramework(mode)
    inputs.property("mode", mode)
    dependsOn(framework.linkTask)

    from({ framework.outputDirectory })
    into(targetDir)

    /// generate a helpful ./gradlew wrapper with embedded Java path
    doLast {
        val gradlew = File(targetDir, "gradlew")
        gradlew.writeText(
            "#!/bin/bash\n"
                + "export 'JAVA_HOME=${System.getProperty("java.home")}'\n"
                + "cd '${rootProject.rootDir}'\n"
                + "./gradlew \$@\n"
        )
        gradlew.setExecutable(true)
    }
}

tasks.getByName("build").dependsOn(packForXcode)

I just have no clue where to look to solve the issue. Maybe you will be able to see the problem here. Thank you for the feedback.

@samhill303
Copy link
Contributor

Are you using CrashKiOS with crashlytics or bugsnag? We aren't initially sure what the issue is. Can you share any more context or a small reproducing project?

@dmikots
Copy link

dmikots commented May 6, 2024

Hi Touchlab,

I tried to implement CrashKiOS for our project and was successful when the app was built for development on iOS. In the production environment, there was a crash immediately after the app started.

Here is the error I picked up from the Console.


Scene FBSceneManager/sceneID:<APPBUNDLE>-default update failed: <NSError: 0x283a1ddd0; domain: FBSceneErrorDomain; code: 1 ("operation-failed"); "Scene update failed."> {

    NSUnderlyingError = <NSError: 0x283a1cba0; domain: FBWorkspaceScene; code: 1; "Client process exited.">;

}


COSMCtrl _foregroundAppActivity incoming bundle <APPBUNDLE>  has nil supplied UUID, finds existing 6C105A4A-1D15-36F9-8818-5CA6E2CAA5B8

Here is my gradle.build.kts for xcode:


import xx.android.bld.dependencies.LibsCommon

import xx.android.bld.dependencies.ModulesCommon

import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget



plugins {

    kotlin(xx.android.bld.dependencies.PluginsCommon.Kotlin.multiplatform)

    id(xx.android.bld.dependencies.PluginsCommon.CrashkiOS.id) version xx.android.bld.dependencies.VersionsCommon.crashkios // HERE

}



kotlin {

    //select iOS target platform depending on the Xcode environment variables

    val iOSTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget =

        if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true)

            ::iosArm64

        else

            ::iosX64



    iOSTarget("ios") {



        binaries {

            framework {

                baseName = "xxcommon"

                export(project(ModulesCommon.domain))

                export(project(ModulesCommon.repositories))

                export(project(ModulesCommon.data))

                export(project(ModulesCommon.appServices))

                export(LibsCommon.Multiplatform.Kodein.erased)

                //export(Libs.Multiplatform.Ktor.Client.Features.common)

            }

        }



    sourceSets {

        all {

            languageSettings.optIn("kotlin.Experimental")

            languageSettings.optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")

            languageSettings.optIn("kotlinx.coroutines.FlowPreview")

            languageSettings.optIn("kotlinx.serialization.InternalSerializationApi")

            //languageSettings.optIn("kotlinx.serialization.UnstableDefault")



            languageSettings.enableLanguageFeature("InlineClasses")

        }



        val commonMain by getting {

            dependencies {

                implementation(LibsCommon.Kotlin.stdLibCommon)

                implementation(LibsCommon.Multiplatform.Kodein.erased)

                //implementation(Libs.Multiplatform.Ktor.Client.Features.common)

                api(project(ModulesCommon.infrastructure))

                api(project(ModulesCommon.domain))

                api(project(ModulesCommon.repositories))

                api(project(ModulesCommon.data))

                api(project(ModulesCommon.appServices))

            }

        }



        val iosMain by getting {

            dependencies {

                implementation(project(ModulesCommon.infrastructure))

                implementation(LibsCommon.Multiplatform.Logging.Napier.ios)

                implementation(LibsCommon.Multiplatform.SQLDelight.Driver.ios)

                implementation(LibsCommon.Crashkios.lib) // HERE

            }

        }

    }



    /*   sourceSets["commonMain"].dependencies {

           implementation(Libs.Kotlin.stdLibCommon)

           api(project(Modules.domain))

           api(project(Modules.repositories))

           api(project(Modules.data))

       } */



}



val packForXcode by tasks.creating(Sync::class) {

    val targetDir = File(buildDir, "xcode-frameworks")



    /// selecting the right configuration for the iOS

    /// framework depending on the environment

    /// variables set by Xcode build

    val mode = System.getenv("CONFIGURATION") ?: "DEBUG"

    val framework = kotlin.targets

        .getByName<KotlinNativeTarget>("ios")

        .binaries.getFramework(mode)

    inputs.property("mode", mode)

    dependsOn(framework.linkTask)



    from({ framework.outputDirectory })

    into(targetDir)



    /// generate a helpful ./gradlew wrapper with embedded Java path

    doLast {

        val gradlew = File(targetDir, "gradlew")

        gradlew.writeText(

            "#!/bin/bash\n"

                + "export 'JAVA_HOME=${System.getProperty("java.home")}'\n"

                + "cd '${rootProject.rootDir}'\n"

                + "./gradlew \$@\n"

        )

        gradlew.setExecutable(true)

    }

}



tasks.getByName("build").dependsOn(packForXcode)

I just have no clue where to look to solve the issue. Maybe you will be able to see the problem here. Thank you for the feedback.

Did you solve the problem?

@shatodj
Copy link
Author

shatodj commented May 6, 2024

Are you using CrashKiOS with crashlytics or bugsnag? We aren't initially sure what the issue is. Can you share any more context or a small reproducing project?

Thanks for your interest. We're using Crashlytics. Currently, we have decided to leave CrashkiOS since we are not able to solve it fast. I will provide a small project once I have more time. It's not trivial.

@dmikots not yet, sadly :(

@tomasjablonskis
Copy link

We have the same issue as well. Everything works until we upload app to TestFlight or App Store then it just crashes on start without any stacktrace to help us track it down.

@DmitriiVM
Copy link

And we are experiencing the same problem as described above.

@shatodj shatodj changed the title Chash on production app Crash on production app May 8, 2024
@TadeasKriz
Copy link
Contributor

Hey everyone, could you try running the app on your device/simulator in Release configuration? It should also crash and should give you a stack trace in Xcode. If you could share that, it'd help us finding a reproducer and a fix. Thank you!

@tomasjablonskis
Copy link

tomasjablonskis commented May 14, 2024

@TadeasKriz the funny thing is that it does not crash in any configuration or on any device until app is uploaded to TestFlight or App Store.

@TadeasKriz
Copy link
Contributor

TadeasKriz commented May 14, 2024

Just to doublecheck, following the steps below don't lead to a crash?

  1. in Xcode click on the "Edit Scheme",
  2. then in "Build" change configuration from "Debug" to "Release"
  3. run on a device

@tomasjablonskis
Copy link

Just to doublecheck, following the steps below don't lead to a crash?

  1. in Xcode click on the "Edit Scheme",
  2. then in "Build" change configuration from "Debug" to "Release"
  3. run on a device

Does not crash.

@TadeasKriz
Copy link
Contributor

Can you check your "Run Phases" to see if any of them have "For install builds only" enabled?

@tomasjablonskis
Copy link

Can you check your "Run Phases" to see if any of them have "For install builds only" enabled?

None of them have "For install builds only" enabled.

@TadeasKriz
Copy link
Contributor

Thanks, that's good to know. Would you be able to tell us more about your specific project? What libraries do you use and how you have everything configured?

@tomasjablonskis
Copy link

Its a simple KMM project. We are consuming shared KMM module on iOS through Cocoapods. We do not have any custom configuration. SPM packages used:

  • Alamofire 5.9.1
  • TunnelKit 6.2.0
  • SocketIO 16.1.0
  • Siren 5.8.1
  • Firebase 10.24.0
  • Lottie 4.4.3

@TadeasKriz
Copy link
Contributor

And on the Kotlin side, what dependencies do you use and how do you have CrashKiOS configured?

@tomasjablonskis
Copy link

Project is multi-modular. About 100 Kotlin modules and 1 main module (Composition) that combines all of them. This library is integrated according to documentation in that main module. Libraries used on KMM side extracted from libs.versions.toml (not all of these are used, but most are):

[versions]
minSDK = "26"
compileSDK = "34"
targetSDK = "34"
maxSDK = "34"
jvmTarget = "19"
javaVersion = "VERSION_19"

kotlin = "1.9.20"
agp = "8.3.2"
coroutines = "1.7.3"
datetime = "0.4.0"
ktor = "2.3.1"
koin = "3.4.2"
multiplatformSettings = "0.9"
sqlDelight = "2.0.1"
kotlinxSerialization = "1.5.1"
kotlinxCoroutinesTest = "1.8.0"
skie = "0.5.6"
buildKonfig = "0.11.0"
detekt = "1.21.0"
semver = "1.0.4"
detektPlugin = "0.2.2"
napier = "2.6.1"

composeCompiler = "1.5.5"
accompanist = "0.31.3-beta"
lifecycle = "2.7.0"
lottieCompose = "6.0.1"
composeDestinations = "1.9.53"
ksp = "1.9.20-1.0.14"
googleServices = "4.4.0"
firebaseGradle = "2.9.9"
firebase = "32.7.0"
androidSplashScreen = "1.0.1"
jvmPlugin = "1.8.0"
composeBom = "2024.02.00"
socketIOJvm = "1.0.0"
androidAppAuth = "0.11.1"
androidDateTimeDialogs = "0.8.1-rc"
androidCamera = "1.3.1"
composeGlide = "1.0.0-beta01"

# VPN-ONLY
androidMaterial = "1.6.1"
composeRuntimeLivedata = "1.2.1"
composeViewModel = "2.5.1"
composeActivity = "1.8.2"
androidAppcompat = "1.5.0"
androidCoreKtx = "1.7.0"

androidGoogleMaps = "18.2.0"
composeGoogleMaps = "2.15.0"
androidBarcodeScanner = "17.2.0"
androidMPCharts = "v3.1.0"
junit = "4.13.2"
androidx-test-ext-junit = "1.1.5"
espresso-core = "3.5.1"

[libraries]
kotlin-gradle-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
sqldelight-gradle-plugin = { group = "app.cash.sqldelight", name = "gradle-plugin", version.ref = "sqlDelight" }
buildKonfig-gradle-plugin = { group = "com.codingfeline.buildkonfig", name = "buildkonfig-gradle-plugin", version.ref = "buildKonfig" }
detekt-gradle-plugin = { group = "io.gitlab.arturbosch.detekt", name = "detekt-gradle-plugin", version.ref = "detekt" }
detekt-plugin = { group = "com.gitlab.cromefire", name = "detekt-gitlab-report", version.ref = "detektPlugin" }
google-services = { group = "com.google.gms", name = "google-services", version.ref = "googleServices" }
firebase-gradle-plugin = { group = "com.google.firebase", name = "firebase-crashlytics-gradle", version.ref = "firebaseGradle" }
android-splashscreen = { group = "androidx.core", name = "core-splashscreen", version.ref = "androidSplashScreen" }

kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutinesTest"}
kotlinx-serialization = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerialization" }
kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "datetime" }

ktor-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" }
ktor-ios = { group = "io.ktor", name = "ktor-client-ios", version.ref = "ktor" }
ktor-cio = { group = "io.ktor", name = "ktor-client-cio", version.ref = "ktor" }
ktor-okhttp = { group = "io.ktor", name = "ktor-client-okhttp", version.ref = "ktor" }
ktor-mock = { group = "io.ktor", name = "ktor-client-mock", version.ref = "ktor" }
ktor-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
ktor-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
ktor-logging = { group = "io.ktor", name = "ktor-client-logging", version.ref = "ktor" }

multiplatform-settings = { group = "com.russhwolf", name = "multiplatform-settings", version.ref = "multiplatformSettings" }
multiplatform-settings-noargs = { group = "com.russhwolf", name = "multiplatform-settings-no-arg", version.ref = "multiplatformSettings" }
multiplatform-settings-mock = { group = "com.russhwolf", name = "multiplatform-settings-test", version.ref = "multiplatformSettings" }

socket-io-jvm = { group = "io.socket", name = "socket.io-client", version.ref = "socketIOJvm" }

napier = { group = "io.github.aakira", name = "napier", version.ref = "napier" }

sqldelight-runtime = { group = "app.cash.sqldelight", name = "runtime", version.ref = "sqlDelight" }
sqldelight-coroutine-extensions = { group = "app.cash.sqldelight", name = "coroutines-extensions", version.ref = "sqlDelight" }
sqldelight-android-driver = { group = "app.cash.sqldelight", name = "android-driver", version.ref = "sqlDelight" }
sqldelight-native-driver = { group = "app.cash.sqldelight", name = "native-driver", version.ref = "sqlDelight" }

firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version.ref = "firebase" }
firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashlytics-ktx" }
firebase-analytics = { group = "com.google.firebase", name = "firebase-analytics-ktx" }
firebase-performance = { group = "com.google.firebase", name = "firebase-perf-ktx" }

koin-core = { group = "io.insert-koin", name = "koin-core", version.ref = "koin" }
koin-test = { group = "io.insert-koin", name = "koin-test", version.ref = "koin" }
koin-android = { group = "io.insert-koin", name = "koin-android", version.ref = "koin" }
koin-compose = { group = "io.insert-koin", name = "koin-androidx-compose", version.ref = "koin" }

accompanist-systemuicontroller = { group = "com.google.accompanist", name = "accompanist-systemuicontroller", version.ref = "accompanist" }
accompanist-permissions = { group = "com.google.accompanist", name = "accompanist-permissions", version.ref = "accompanist" }
accompanist-insets = { group = "com.google.accompanist", name = "accompanist-insets", version.ref = "accompanist" }
accompanist-flowLayout = { group = "com.google.accompanist", name = "accompanist-flowlayout", version.ref = "accompanist" }

compose-glide = { group = "com.github.bumptech.glide", name = "compose", version.ref = "composeGlide" }
compose-google-maps = { group = "com.google.maps.android", name = "maps-compose", version.ref = "composeGoogleMaps" }
compose-lottie = { group = "com.airbnb.android", name = "lottie-compose", version.ref = "lottieCompose" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
compose-runtime = { group = "androidx.compose.runtime", name = "runtime" }
compose-ui = { group = "androidx.compose.ui", name = "ui" }
compose-ui-tooling = {group = "androidx.compose.ui", name = "ui-tooling"}
compose-ui-tooling-preview = {group = "androidx.compose.ui", name = "ui-tooling-preview"}
compose-foundation = { group = "androidx.compose.foundation", name = "foundation" }
compose-material = { group = "androidx.compose.material", name = "material" }
compose-materialIcons = { group = "androidx.compose.material", name = "material-icons-extended" }
compose-material3 = { group = "androidx.compose.material3", name = "material3" }
compose-destinations-core = { group = "io.github.raamcosta.compose-destinations", name = "core", version.ref = "composeDestinations" }
compose-destinations-animations = { group = "io.github.raamcosta.compose-destinations", name = "animations-core", version.ref = "composeDestinations" }
compose-destinations-ksp = { group = "io.github.raamcosta.compose-destinations", name = "ksp", version.ref = "composeDestinations" }

androidx-camera-core = { group = "androidx.camera", name = "camera-camera2", version.ref = "androidCamera" }
androidx-camera-lifecycle = { group = "androidx.camera", name = "camera-lifecycle", version.ref = "androidCamera" }
androidx-camera-view = { group = "androidx.camera", name = "camera-view", version.ref = "androidCamera" }

androidx-lifecycle-runtime = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" }
androidx-lifecycle-viewmodel = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycle" }
androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }

android-appauth = { group = "net.openid", name = "appauth", version.ref = "androidAppAuth" }

android-material = { group = "com.google.android.material", name = "material", version.ref = "androidMaterial" }
compose-runtime-livedata = { group = "androidx.compose.runtime", name = "runtime-livedata", version.ref = "composeRuntimeLivedata" }
compose-viewmodel = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "composeViewModel" }
compose-activity = { group = "androidx.activity", name = "activity-compose", version.ref = "composeActivity" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidAppcompat" }
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidCoreKtx" }

android-google-maps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "androidGoogleMaps" }
android-barcodeScanner = { group = "com.google.mlkit", name = "barcode-scanning", version.ref = "androidBarcodeScanner" }
android-mpCharts = { group = "com.github.PhilJay", name = "MPAndroidChart", version.ref = "androidMPCharts" }
android-dateTimeDialogs = { group = "io.github.vanpra.compose-material-dialogs", name = "datetime", version.ref = "androidDateTimeDialogs" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" }
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" }

[plugins]
detekt-plugin = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
kotlin-plugin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlinx-serialization-plugin = { id = "plugin.serialization", version.ref = "kotlin" }
cocoapods-plugin = { id = "native.cocoapods" }
multiplatform-plugin = { id = "multiplatform" }
android-library = { id = "com.android.library", version.ref = "agp" }
jvm-plugin = { id = "org.jetbrains.kotlin.jvm", version.ref = "jvmPlugin" }
sqldelight-plugin = { id = "app.cash.sqldelight", version.ref = "sqlDelight" }
ksp-plugin = { id = "com.google.devtools.ksp", version.ref = "ksp" }
skie-plugin = { id = "co.touchlab.skie", version.ref = "skie" }

@tomasjablonskis
Copy link

P.S.: project is using Dynamic linking, so we have integrated co.touchlab.crashkios.crashlyticslink plugin as well.

@TadeasKriz
Copy link
Contributor

TadeasKriz commented May 14, 2024

Thanks, that's good info. Last thing to try that comes to mind, could you try and compare the .app built for iOS Arm64 using Release configuration, but built for a device in Xcode and then the one extracted from .ipa file you get from the "Archive" action?

I'm basically trying to find whether this happens before it's uploaded to AppStore Connect, or if AppStore Connect somehow breaks it (which shouldn't happen).

Oh, and if you could download .ipa that crashes from TestFlight, extract the .app and compare it too, that would probably help too.

@TadeasKriz
Copy link
Contributor

TadeasKriz commented Jun 11, 2024

@tomasjablonskis @shatodj @DmitriiVM Do you have more information on this? Possibly a stack trace for the crash, or dyld logs perhaps?

@shatodj
Copy link
Author

shatodj commented Jun 17, 2024

Hi @TadeasKriz

I've got you the crash report (obfuscated a bit) when running iOS app on the Mac OS using the CrashKiOS.
I'm not sure how to get dyld logs from iOS thought.

The app is working good without the CrashKiOS.

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: 55F94B15-A2FE-49DE-9C36-AA461EFFE02F
CrashReporter Key:   1401BC88-2CD0-C68A-5D9A-F693EDC04FE0
Hardware Model:      Mac14,10
Process:             XXX UAT [43448]
Path:                /private/var/folders/*/XXX UAT.app/XXX UAT
Identifier:          xxxx
Version:             1.19.0 (4)
Code Type:           ARM-64 (Native)
Role:                Background
Parent Process:      launchd [1]
Coalition:          xxxx [8133]

Date/Time:           2024-06-17 14:48:09.5742 +0200
Launch Time:         2024-06-17 14:48:07.1906 +0200
OS Version:          macOS 14.5 (23F79)
Release Type:        User
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: DYLD 0 
symbol not found in flat namespace '_OBJC_CLASS_$_FIRCrashlytics'

Triggered by Thread:  0

Thread 0 Crashed:
0   dyld                          	       0x19fceda50 __abort_with_payload + 8
1   dyld                          	       0x19fcf8628 abort_with_payload_wrapper_internal + 104
2   dyld                          	       0x19fcf865c abort_with_payload + 16
3   dyld                          	       0x19fc8a6b0 dyld4::halt(char const*, dyld4::StructuredError const*) + 304
4   dyld                          	       0x19fc87258 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3888
5   dyld                          	       0x19fc85edc start + 1844


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000006   x1: 0x0000000000000000   x2: 0x000000016b4fb320   x3: 0x0000000000000014
    x4: 0x000000016b4faf20   x5: 0x0000000000000000   x6: 0x000000016b4f9dc0   x7: 0x0000000000000000
    x8: 0x0000000000000020   x9: 0x000000016b4fae8a  x10: 0x000000000000000a  x11: 0x0000000000000000
   x12: 0x0000000000000034  x13: 0x0000000000000000  x14: 0x000000028c5b1e8f  x15: 0x000000016b4fa0c8
   x16: 0x0000000000000209  x17: 0x000000019fc8337c  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x000000016b4faf20  x21: 0x0000000000000014  x22: 0x000000016b4fb320  x23: 0x0000000000000000
   x24: 0x0000000000000006  x25: 0x00000000000019c8  x26: 0x000000016b4ff0a8  x27: 0x000000010932a3a8
   x28: 0x0000000000000001   fp: 0x000000016b4faef0   lr: 0x000000019fcf8628
    sp: 0x000000016b4faeb0   pc: 0x000000019fceda50 cpsr: 0x80001000
   far: 0x0000000000000000  esr: 0x56000080  Address size fault

Binary Images:
       0x109468000 -        0x1094c3fff org.cocoapods.Alamofire (4.9.1) <4a9d6c3d-e6b4-340f-ba2e-2019186f4e29> /private/var/folders/*/XXX UAT.app/Frameworks/Alamofire.framework/Alamofire
       0x1093e8000 -        0x109413fff org.cocoapods.Caishen (2.2.1) <7ae9a917-7cf2-30c6-96f4-11bb2fe2ccb2> /private/var/folders/*/XXX UAT.app/Frameworks/Caishen.framework/Caishen
       0x1097d0000 -        0x10997ffff com.salesforce.MarketingCloudSDK (8.0.10) <981a4037-1d90-3e81-a2e2-2391b2885ab8> /private/var/folders/*/XXX UAT.app/Frameworks/MarketingCloudSDK.framework/MarketingCloudSDK
       0x10b6c0000 -        0x10bfe7fff com.microsoft.maps.MicrosoftMaps (1.0) <8b1eb18d-bc5e-3a6b-b585-b65b21f6276c> /private/var/folders/*/XXX UAT.app/Frameworks/MicrosoftMaps.framework/MicrosoftMaps
       0x109604000 -        0x109637fff org.cocoapods.Monri (1.4.0) <7a7aa0a2-2b87-3170-923f-20b1f9382dc7> /private/var/folders/*/XXX UAT.app/Frameworks/Monri.framework/Monri
       0x109a3c000 -        0x109a9ffff com.salesforce.marketingcloud.core (1.0.6) <500f9a8b-35a2-3df5-b006-7a74a340430a> /private/var/folders/*/XXX UAT.app/Frameworks/SFMCSDK.framework/SFMCSDK
       0x114ab4000 -        0x11713ffff xxx.xxxx.xxx.xcode.XXXcommon (1.0) <193fa3f5-1f7e-3123-a6b8-c69ece7ffee1> /private/var/folders/*/XXX UAT.app/Frameworks/XXXcommon.framework/XXXcommon
       0x10a150000 -        0x10a72ffff com.onetrust.OTPublishersHeadlessSDK (202303.2.0) <8cbd7111-9cc0-3d3a-a558-7c5147ae47b3> /private/var/folders/*/XXX UAT.app/Frameworks/OTPublishersHeadlessSDK.framework/OTPublishersHeadlessSDK
       0x109c1c000 -        0x109d03fff com.medallia.dxa.MedalliaDXA (1.0) <b1f82fa1-5a01-315f-bb2d-b1c3513d1fba> /private/var/folders/*/XXX UAT.app/Frameworks/MedalliaDXA.framework/MedalliaDXA
       0x1096a4000 -        0x10970ffff com.adyen.Adyen3DS2 (2.3.3) <533f714e-b509-3425-8537-85ddd031c5a2> /private/var/folders/*/XXX UAT.app/Frameworks/Adyen3DS2.framework/Adyen3DS2
       0x104900000 -        0x1085abfff xxx.xxxx.xxx.uat (1.19.0) <d7d7c610-b613-3269-9772-5488e096b75e> /private/var/folders/*/XXX UAT.app/XXX UAT
       0x19fc80000 -        0x19fd08a17 dyld (*) <37bbc384-0755-31c7-a808-0ed49e44dd8e> /usr/lib/dyld
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

EOF

-----------
Full Report
-----------

{"app_name":"XXX UAT","timestamp":"2024-06-17 14:48:25.00 +0200","app_version":"1.19.0","slice_uuid":"d7d7c610-b613-3269-9772-5488e096b75e","build_version":"4","platform":2,"bundleID":"xxx.xxxx.xxx.uat","share_with_app_devs":1,"is_first_party":0,"bug_type":"309","os_version":"macOS 14.5 (23F79)","roots_installed":0,"name":"XXX UAT","incident_id":"55F94B15-A2FE-49DE-9C36-AA461EFFE02F"}
{
  "uptime" : 26000,
  "procRole" : "Background",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "Mac14,10",
  "coalitionID" : 8133,
  "osVersion" : {
    "train" : "macOS 14.5",
    "build" : "23F79",
    "releaseType" : "User"
  },
  "captureTime" : "2024-06-17 14:48:09.5742 +0200",
  "codeSigningMonitor" : 1,
  "incident" : "55F94B15-A2FE-49DE-9C36-AA461EFFE02F",
  "pid" : 43448,
  "translated" : false,
  "cpuType" : "ARM-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2024-06-17 14:48:07.1906 +0200",
  "procStartAbsTime" : 627282911874,
  "procExitAbsTime" : 627340108935,
  "procName" : "XXX UAT",
  "procPath" : "\/private\/var\/folders\/*\/XXX UAT.app\/XXX UAT",
  "bundleInfo" : {"CFBundleShortVersionString":"1.19.0","CFBundleVersion":"4","CFBundleIdentifier":"xxx.xxxx.xxx.uat"},
  "storeInfo" : {"deviceIdentifierForVendor":"6F7ED2B5-EE56-5A2F-AF34-BA72A5DC5F30","thirdParty":true},
  "parentProc" : "launchd",
  "parentPid" : 1,
  "coalitionName" : "xxx.xxxx.xxx.uat",
  "crashReporterKey" : "1401BC88-2CD0-C68A-5D9A-F693EDC04FE0",
  "codeSigningID" : "xxx.xxxx.xxx.uat",
  "codeSigningTeamID" : "M6QXCQPY2H",
  "codeSigningFlags" : 570454785,
  "codeSigningValidationCategory" : 5,
  "codeSigningTrustLevel" : 4294967295,
  "instructionByteStream" : {"beforePC":"1AAAABABAAAYAQAAIAEAACgBAAAwAQAAOAEAAFQBAAAwQYDSARAA1A==","atPC":"AwEAVH8jA9X9e7+p\/QMAkQpV\/pe\/AwCR\/XvBqP8PX9bAA1\/WEC2A0g=="},
  "wakeTime" : 7510,
  "sleepWakeUUID" : "AF41A2C4-6BAD-4E91-B6B4-7A6EB625B98C",
  "sip" : "enabled",
  "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
  "termination" : {"code":0,"flags":518,"namespace":"DYLD","reasons":["symbol not found in flat namespace '_OBJC_CLASS_$_FIRCrashlytics'"]},
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":690522,"threadState":{"x":[{"value":6},{"value":0},{"value":6095352608},{"value":20},{"value":6095351584},{"value":0},{"value":6095347136},{"value":0},{"value":32},{"value":6095351434},{"value":10},{"value":0},{"value":52},{"value":0},{"value":10944716431},{"value":6095347912},{"value":521},{"value":6975665020,"symbolLocation":416,"symbol":"__simple_bprintf"},{"value":0},{"value":0},{"value":6095351584},{"value":20},{"value":6095352608},{"value":0},{"value":6},{"value":6600},{"value":6095368360},{"value":4449280936},{"value":1}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6976144936},"cpsr":{"value":2147487744},"fp":{"value":6095351536},"sp":{"value":6095351472},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":6976100944,"matchesCrashFrame":1},"far":{"value":0}},"frames":[{"imageOffset":449104,"symbol":"__abort_with_payload","symbolLocation":8,"imageIndex":11},{"imageOffset":493096,"symbol":"abort_with_payload_wrapper_internal","symbolLocation":104,"imageIndex":11},{"imageOffset":493148,"symbol":"abort_with_payload","symbolLocation":16,"imageIndex":11},{"imageOffset":42672,"symbol":"dyld4::halt(char const*, dyld4::StructuredError const*)","symbolLocation":304,"imageIndex":11},{"imageOffset":29272,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":3888,"imageIndex":11},{"imageOffset":24284,"symbol":"start","symbolLocation":1844,"imageIndex":11}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4450582528,
    "CFBundleShortVersionString" : "4.9.1",
    "CFBundleIdentifier" : "org.cocoapods.Alamofire",
    "size" : 376832,
    "uuid" : "4a9d6c3d-e6b4-340f-ba2e-2019186f4e29",
    "path" : "\/private\/var\/folders\/*\/XXX UAT.app\/Frameworks\/Alamofire.framework\/Alamofire",
    "name" : "Alamofire",
    "CFBundleVersion" : "1"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4450058240,
    "CFBundleShortVersionString" : "2.2.1",
    "CFBundleIdentifier" : "org.cocoapods.Caishen",
    "size" : 180224,
    "uuid" : "7ae9a917-7cf2-30c6-96f4-11bb2fe2ccb2",
    "path" : "\/private\/var\/folders\/*\/XXX UAT.app\/Frameworks\/Caishen.framework\/Caishen",
    "name" : "Caishen",
    "CFBundleVersion" : "1"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4454154240,
    "CFBundleShortVersionString" : "8.0.10",
    "CFBundleIdentifier" : "com.salesforce.MarketingCloudSDK",
    "size" : 1769472,
    "uuid" : "981a4037-1d90-3e81-a2e2-2391b2885ab8",
    "path" : "\/private\/var\/folders\/*\/XXX UAT.app\/Frameworks\/MarketingCloudSDK.framework\/MarketingCloudSDK",
    "name" : "MarketingCloudSDK",
    "CFBundleVersion" : "8.0.10"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4486594560,
    "CFBundleShortVersionString" : "1.0",
    "CFBundleIdentifier" : "com.microsoft.maps.MicrosoftMaps",
    "size" : 9601024,
    "uuid" : "8b1eb18d-bc5e-3a6b-b585-b65b21f6276c",
    "path" : "\/private\/var\/folders\/*\/XXX UAT.app\/Frameworks\/MicrosoftMaps.framework\/MicrosoftMaps",
    "name" : "MicrosoftMaps",
    "CFBundleVersion" : "1"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4452270080,
    "CFBundleShortVersionString" : "1.4.0",
    "CFBundleIdentifier" : "org.cocoapods.Monri",
    "size" : 212992,
    "uuid" : "7a7aa0a2-2b87-3170-923f-20b1f9382dc7",
    "path" : "\/private\/var\/folders\/*\/XXX UAT.app\/Frameworks\/Monri.framework\/Monri",
    "name" : "Monri",
    "CFBundleVersion" : "1"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4456693760,
    "CFBundleShortVersionString" : "1.0.6",
    "CFBundleIdentifier" : "com.salesforce.marketingcloud.core",
    "size" : 409600,
    "uuid" : "500f9a8b-35a2-3df5-b006-7a74a340430a",
    "path" : "\/private\/var\/folders\/*\/XXX UAT.app\/Frameworks\/SFMCSDK.framework\/SFMCSDK",
    "name" : "SFMCSDK",
    "CFBundleVersion" : "1.0.6"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4641734656,
    "CFBundleShortVersionString" : "1.0",
    "CFBundleIdentifier" : "xxx.xxxx.xxx.xcode.XXXcommon",
    "size" : 40419328,
    "uuid" : "193fa3f5-1f7e-3123-a6b8-c69ece7ffee1",
    "path" : "\/private\/var\/folders\/*\/XXX UAT.app\/Frameworks\/XXXcommon.framework\/XXXcommon",
    "name" : "XXXcommon",
    "CFBundleVersion" : "1"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4464115712,
    "CFBundleShortVersionString" : "202303.2.0",
    "CFBundleIdentifier" : "com.onetrust.OTPublishersHeadlessSDK",
    "size" : 6160384,
    "uuid" : "8cbd7111-9cc0-3d3a-a558-7c5147ae47b3",
    "path" : "\/private\/var\/folders\/*\/XXX UAT.app\/Frameworks\/OTPublishersHeadlessSDK.framework\/OTPublishersHeadlessSDK",
    "name" : "OTPublishersHeadlessSDK",
    "CFBundleVersion" : "1"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4458659840,
    "CFBundleShortVersionString" : "1.0",
    "CFBundleIdentifier" : "com.medallia.dxa.MedalliaDXA",
    "size" : 950272,
    "uuid" : "b1f82fa1-5a01-315f-bb2d-b1c3513d1fba",
    "path" : "\/private\/var\/folders\/*\/XXX UAT.app\/Frameworks\/MedalliaDXA.framework\/MedalliaDXA",
    "name" : "MedalliaDXA",
    "CFBundleVersion" : "1"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4452925440,
    "CFBundleShortVersionString" : "2.3.3",
    "CFBundleIdentifier" : "com.adyen.Adyen3DS2",
    "size" : 442368,
    "uuid" : "533f714e-b509-3425-8537-85ddd031c5a2",
    "path" : "\/private\/var\/folders\/*\/XXX UAT.app\/Frameworks\/Adyen3DS2.framework\/Adyen3DS2",
    "name" : "Adyen3DS2",
    "CFBundleVersion" : "25"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4371513344,
    "CFBundleShortVersionString" : "1.19.0",
    "CFBundleIdentifier" : "xxx.xxxx.xxx.uat",
    "size" : 63619072,
    "uuid" : "d7d7c610-b613-3269-9772-5488e096b75e",
    "path" : "\/private\/var\/folders\/*\/XXX UAT.app\/XXX UAT",
    "name" : "XXX UAT",
    "CFBundleVersion" : "4"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6975651840,
    "size" : 559640,
    "uuid" : "37bbc384-0755-31c7-a808-0ed49e44dd8e",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "sharedCache" : {
  "base" : 6974898176,
  "size" : 4220698624,
  "uuid" : "3406ad1b-2469-30eb-9863-5dce861e6dea"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=1.5G resident=0K(0%) swapped_out_or_unallocated=1.5G(100%)\nWritable regions: Total=13.7M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=13.7M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nSTACK GUARD                       56.0M        1 \nStack                             8176K        1 \nVM_ALLOCATE                         16K        1 \n__AUTH                            3734K      555 \n__AUTH_CONST                      38.4M      791 \n__CTF                               824        1 \n__DATA                            31.9M      790 \n__DATA_CONST                      45.1M      807 \n__DATA_DIRTY                      2756K      316 \n__FONT_DATA                          4K        1 \n__LINKEDIT                       628.6M       12 \n__OBJC_RO                         71.9M        1 \n__OBJC_RW                         2199K        1 \n__TEXT                           950.6M      833 \ndyld private memory               4384K        4 \n===========                     =======  ======= \nTOTAL                              1.8G     4115 \n",
  "legacyInfo" : {
  "threadTriggered" : {

  }
},
  "logWritingSignature" : "226bdb1b20c85310ae2fbcc64ea2f1b5f6fed166",
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "64628732bf2f5257dedc8988",
      "factorPackIds" : {

      },
      "deploymentId" : 240000001
    },
    {
      "rolloutId" : "654439cdafbf5b61207873a9",
      "factorPackIds" : {

      },
      "deploymentId" : 240000004
    }
  ],
  "experiments" : [
    {
      "treatmentId" : "45f4e2a5-551b-4bc2-a2dc-19c244dda8f8",
      "experimentId" : "6643969b3099cf28e049862f",
      "deploymentId" : 400000002
    }
  ]
}
}

@TadeasKriz
Copy link
Contributor

This seems to be caused by App Thinning removing the Crashlytics dependency. I think it’s because we’re using -U to allow building without actually linking Crashlytics in KMP.

We already plan to implement a different workaround by compiling a stub framework and linking against it instead. That way AppThinning will see the dependency and wont remove the symbols.

For now you should be able to workaround this by explicitly importing and using Crashlytics in your Swift code.

@shatodj
Copy link
Author

shatodj commented Jun 18, 2024

@TadeasKriz So I have FirebaseCrashlytics imported in the code already. But still, I put another import in to the AppDelegate and call at least one method from it. It didn't help. App is still crashing:

import FirebaseCore
import FirebaseCrashlytics

// ...

func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
   configureCrashKiOS()
}

 private func configureCrashKiOS() {
        // test crashlytics fix
        _ = Crashlytics.crashlytics().isCrashlyticsCollectionEnabled()

        // configure CrashKiOS in common
        IOSDIKt.startCrashKiOS()
    }

Maybe is good to mention that we are using Firebase SPM package.

@JackHurst0
Copy link

Are there plans to fix this issue? It's the only thing blocking my team from updating our apps to Kotlin 2.0

Thanks :)

@dmikots
Copy link

dmikots commented Jun 27, 2024

Are there plans to fix this issue? It's the only thing blocking my team from updating our apps to Kotlin 2.0

Thanks :)

The same thing 😅

@TadeasKriz
Copy link
Contributor

TadeasKriz commented Jun 27, 2024

I was able to reproduce this, it's not app thinning but deployment processing. More specifically the strip command now ignores that the framework needs these symbols (seems to be introduced by the new Xcode linker). I've replaced static calls to Crashlytics with dynamic objc calls in a PR (#71). This still requires one undefined symbol, but that one isn't being stripped.

Since this is a larger change, we want to do some more internal testing before releasing it. I'll keep you posted.

In the meantime, making your KMP framework static will work around the issue.

@samhill303
Copy link
Contributor

Should be resolved on 0.9.0. Please try it out and let us know if there are any further issues!

@shatodj
Copy link
Author

shatodj commented Sep 3, 2024

Hi there. Thank you for fixing the crash. There has been some good progress. However, I have another crash in production only with a different trace log. But maybe I'm still missing something.


Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000192300ae8
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [45624]

Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                	       0x18e83b2e0 __exceptionPreprocess + 164
1   libobjc.A.dylib               	       0x18e322788 objc_exception_throw + 60
2   xxxxxxxxx                     	       0x1199bccd0 FIRCheckLinkDependencies + 84
3   xxxxxxxxx                     	       0x119ed271c kfun:co.touchlab.crashkios.crashlytics.CrashlyticsCallsActual#<init>(){} + 100 (CrashlyticsCallsActual.kt:12)
4   xxxxxxxxx                     	       0x119ed36d0 kfun:co.touchlab.crashkios.crashlytics#enableCrashlytics(){} + 132 (CrashlyticsKotlin.kt:34)
5   xxxxxxxxx                     	       0x118d8c0ec kfun:com.yyyyyyyy.xxx.xcode#startCrashKiOS(){} + 80 (iOSDI.kt:897)
6   xxxxxxxxx                     	       0x11993d1f0 objc2kotlin_kfun:com.yyyyyyyy.xxx.xcode#startCrashKiOS(){} + 96 (<compiler-generated>:1)
7   yyyyyyyyyyy                  	       0x10024bea0 AppDelegate.configureDependencies() + 668 (AppDelegate.swift:137)
8   yyyyyyyyyyy                  	       0x10024ea14 AppDelegate.onStart() + 0 [inlined]
9   yyyyyyyyyyy                  	       0x10024ea14 specialized AppDelegate.application(_:didFinishLaunchingWithOptions:) + 212 (AppDelegate.swift:64)
10  yyyyyyyyyyy                  	       0x10024b71c AppDelegate.application(_:didFinishLaunchingWithOptions:) + 8 [inlined]
11  yyyyyyyyyyy                  	       0x10024b71c @objc AppDelegate.application(_:didFinishLaunchingWithOptions:) + 112 (/<compiler-generated>:59)
12  UIKitCore                     	       0x1bdc43904 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 316
13  UIKitCore                     	       0x1bdc42dc4 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 2832
14  UIKitCore                     	       0x1bdc410ac -[UIApplication _runWithMainScene:transitionContext:completion:] + 988
15  UIKitCore                     	       0x1bdc40be0 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 108
16  UIKitCore                     	       0x1bdc3d6c8 _UIScenePerformActionsWithLifecycleActionMask + 112
17  UIKitCore                     	       0x1bdc4052c __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 216
18  UIKitCore                     	       0x1bdc402b0 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 332
19  UIKitCore                     	       0x1bdc3f80c -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 608
20  UIKitCore                     	       0x1bdc3f508 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 248
21  UIKitCore                     	       0x1bdc3dca4 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 148
22  UIKitCore                     	       0x1be499ab8 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736
23  UIKitCore                     	       0x1be58c504 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224
24  UIKitCore                     	       0x1bdc3d850 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316
25  UIKitCore                     	       0x1bdf5a45c __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.243 + 612
26  UIKitCore                     	       0x1bdc3ccec -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216
27  UIKitCore                     	       0x1bdc3cb5c -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244
28  UIKitCore                     	       0x1bdc32864 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 508
29  UIKitCore                     	       0x1bdc325f0 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 288
30  FrontBoardServices            	       0x1a42e0ad8 -[FBSScene _callOutQueue_didCreateWithTransitionContext:completion:] + 340
31  FrontBoardServices            	       0x1a4309284 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.139 + 284
32  FrontBoardServices            	       0x1a42cb048 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 196
33  FrontBoardServices            	       0x1a4308f98 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke + 348
34  libdispatch.dylib             	       0x18e5363e8 _dispatch_client_callout + 20
35  libdispatch.dylib             	       0x18e539e80 _dispatch_block_invoke_direct + 288
36  FrontBoardServices            	       0x1a42caf5c __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48
37  FrontBoardServices            	       0x1a43290b4 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240
38  FrontBoardServices            	       0x1a43291e8 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28
39  CoreFoundation                	       0x18e7c64d8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
40  CoreFoundation                	       0x18e7c646c __CFRunLoopDoSource0 + 176
41  CoreFoundation                	       0x18e7c61dc __CFRunLoopDoSources0 + 244
42  CoreFoundation                	       0x18e7c4dc8 __CFRunLoopRun + 828
43  CoreFoundation                	       0x18e7c4434 CFRunLoopRunSpecific + 608
44  HIToolbox                     	       0x198f6819c RunCurrentEventLoopInMode + 292
45  HIToolbox                     	       0x198f67e2c ReceiveNextEventCommon + 220
46  HIToolbox                     	       0x198f67d30 _BlockUntilNextEventMatchingListInModeWithFilter + 76
47  AppKit                        	       0x192023d68 _DPSNextEvent + 660
48  AppKit                        	       0x192819808 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 700
49  AppKit                        	       0x19201709c -[NSApplication run] + 476
50  AppKit                        	       0x191fee2e0 NSApplicationMain + 880
51  AppKit                        	       0x192241a30 +[NSWindow _savedFrameFromString:] + 0
52  UIKitMacHelper                	       0x1a7a8ef40 UINSApplicationMain + 972
53  UIKitCore                     	       0x1bdc1b570 UIApplicationMain + 148
54  yyyyyyyyyyy                  	       0x10024e85c main + 64 (AppDelegate.swift:18)
55  dyld                          	       0x18e35e0e0 start + 2360

@samhill303 samhill303 reopened this Sep 10, 2024
@MrBenjoo
Copy link

MrBenjoo commented Sep 13, 2024

I had the same problem with unresolved symbol, updating the plugin version from 0.8.6 to 0.9.0 seems to have solved the issue. But as OP, I have now stumbled upon a new issue. We are exposing a dynamic framework to iOS, everything is working fine until we archive it and release it on test flight. As soon as we open the app, it crashes. This is the error log from iOS:

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
abort() called


Last Exception Backtrace:
0   CoreFoundation                	       0x181adfc80 __exceptionPreprocess + 216
1   libobjc.A.dylib               	       0x199305ee4 objc_exception_throw + 56
2   watch                         	       0x103a049bc objc2kotlin_kfun:com.project.watch#crashInit(){} + 1812
3   WatchApp                       	       0x100bbd5e4 0x100ba4000 + 103908
4   WatchApp                       	       0x100bbd2f0 0x100ba4000 + 103152
5   libdispatch.dylib             	       0x1817a0094 _dispatch_client_callout + 16
6   libdispatch.dylib             	       0x181741acc _dispatch_once_callout + 28
7   WatchApp                       	       0x100bbe388 0x100ba4000 + 107400
8   WatchApp                       	       0x10106d09c 0x100ba4000 + 5017756
9   WatchApp                       	       0x101054b60 0x100ba4000 + 4918112
10  WatchApp                       	       0x101055e20 0x100ba4000 + 4922912
11  WatchApp                       	       0x101056d88 0x100ba4000 + 4926856
12  UIKitCore                     	       0x1840925c4 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 336
13  UIKitCore                     	       0x184266d98 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 3508
14  UIKitCore                     	       0x1842504bc -[UIApplication _runWithMainScene:transitionContext:completion:] + 1176
15  UIKitCore                     	       0x1840be2d4 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 148
16  UIKitCore                     	       0x183f24ff8 _UIScenePerformActionsWithLifecycleActionMask + 96
17  UIKitCore                     	       0x184047a2c __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 188
18  UIKitCore                     	       0x18415d008 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 240
19  UIKitCore                     	       0x184385434 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 744
20  UIKitCore                     	       0x184315174 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 336
21  UIKitCore                     	       0x183f25d44 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 188
22  UIKitCore                     	       0x183fe1934 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 812
23  UIKitCore                     	       0x183f27ad4 _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 248
24  UIKitCore                     	       0x18400c184 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 356
25  UIKitCore                     	       0x184461f38 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.578 + 772
26  UIKitCore                     	       0x183f5577c -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 248
27  UIKitCore                     	       0x183f9751c -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 264
28  UIKitCore                     	       0x1840c2d3c -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 560
29  UIKitCore                     	       0x18400a5a0 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 360
30  FrontBoardServices            	       0x192c65c50 -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 412
31  FrontBoardServices            	       0x192c87f98 __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke.180 + 100
32  FrontBoardServices            	       0x192c48bdc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 232
33  FrontBoardServices            	       0x192c49fd4 __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke + 312
34  libdispatch.dylib             	       0x1817a0094 _dispatch_client_callout + 16
35  libdispatch.dylib             	       0x181743150 _dispatch_block_invoke_direct$VARIANT$mp + 220
36  FrontBoardServices            	       0x192c4a2ac __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
37  FrontBoardServices            	       0x192c497c0 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 176
38  FrontBoardServices            	       0x192c4d960 -[FBSSerialQueue _performNextFromRunLoopSource] + 24
39  CoreFoundation                	       0x181b00468 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
40  CoreFoundation                	       0x181b10598 __CFRunLoopDoSource0 + 204
41  CoreFoundation                	       0x181a52774 __CFRunLoopDoSources0 + 256
42  CoreFoundation                	       0x181a57e48 __CFRunLoopRun + 768
43  CoreFoundation                	       0x181a6b194 CFRunLoopRunSpecific + 572
44  GraphicsServices              	       0x1a257e988 GSEventRunModal + 160
45  UIKitCore                     	       0x18426ea88 -[UIApplication _run] + 1080
46  UIKitCore                     	       0x184007fc8 UIApplicationMain + 336
47  WatchApp                       	       0x1010577e0 0x100ba4000 + 4929504
48  dyld                          	       0x102e504d0 start + 444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants