I have an android_arm64 shared library (in release...
# kotlin-native
k
I have an android_arm64 shared library (in release mode) named "liba.so" which compiled by kotlin/native compiler. Is there any way recovery a crash stack when "liba.so" was crash?? I used add2line (it location is ".konan/dependencies/target-toolchain-2-osx-android_ndk/bin/aarch64-linux-android-addr2line") tool and "liba.so" (in debug mode), but was failed to get crash stack🥲
n
I had good luck with stack traces by using the latest NDK. Kotlin is stuck on some ancient NDK version. To update, for example, for android_arm64 on apple silicon, use
-Xoverride-konan-properties=targetToolchain.macos_arm64-android_arm64=<toolchain>
<toolchain> should be path to newer NDK ndk/toolchains/llvm/prebuilt/darwin if I remember correctly. Be prepared for some errors here and there but it’s worth the effort.
k
can you please tell me your ndk version? I use ndk '23.2.8568313', but compile error like this
n
23-something too. You won’t like the solution to this one 😄 but here it is. See comments
Running this in a gradle plugin before compilation, but you can create a simple task in your build file
k
this solution help me compile success😄. but I still fail to recovery crash stack in release mode.🥲
can you please share me how do you get crash stack on a release-mode .so file??
n
I'm not sure about that, sorry. I remember that NDK update enables clear stack traces in the device logcat, during development
k
thanks for helping😀