Hi, I use _`getStackTraceAddresses`_ to creat cras...
# kotlin-native
f
Hi, I use
getStackTraceAddresses
to creat crash report in my iOS application. When I use debug build I can got a detailed report. But when I use release build, I just got some address in iOS no share code address. Any idea?
k
What version?
f
my kotlin version is
1.3.72
k
You probably need this setting. I think in 1.4.0 you don’t but not sure yet: https://github.com/touchlab/CrashKiOS#status
f
Thanks!
Copy code
iosArm64() {
        binaries {
            framework("iosArm64") {
                freeCompilerArgs += "-Xg0"
                if(it instanceof org.jetbrains.kotlin.gradle.plugin.mpp.Framework) {
                    isStatic = true
                }
            }
        }
    }
I’ve tried, but it’s not work for me.😢
k
Ah, docs need to be updated. You can get rid of the `
Copy code
if(it instanceof org.jetbrains.kotlin.gradle.plugin.mpp.Framework) {
                    isStatic = true
                }
I think, anyway. You just need
freeCompilerArgs += "-Xg0"
. Are you running groovy or kts scripts?
f
I’m using groovy.
k
What does your config look like?
f
Copy code
kotlin {
    android()
    android {
        publishLibraryVariants("release", "debug")
    }

    iosX64("ios") {
        binaries {
            framework("iosX64") {
                freeCompilerArgs += "-Xg0"
            }
        }
    }

    iosArm64() {
        binaries {
            framework("iosArm64") {
                freeCompilerArgs += "-Xg0"
            }
        }
    }

    iosArm32() {
        binaries {
            framework("iosArm32") {
                freeCompilerArgs += "-Xg0"
            }
        }
    }
cocoapods {
 	......
}
sourceSets {
	......
}
}
Are you talking about this?
k
Yeah, so if you’re using cocoapods you can’t also declare
framework
in the binaries section. They will conflict. Off hand I’m not sure how you’d apply the compiler args in that context.
In 1.3.72, you’ll need to get “-Xg0” into freeCompilerArgs. In 1.4, I don’t think you need to.
👍 1
f
Yes, I see. Thank you very much. I think kotlin 1.4 might be my best bet.