libshop.so + 0x398 into cart_total in shop.c:13,
inlined frames included, with that library’s debug information. See
Android native code for what is symbolicated.
Native crash reports come from Android 12 and later. The stack of a native crash on older
versions is not available to apps.
With the Gradle plugin
The Apsio Gradle plugin (io.apsio.gradle) does it on every release build. Its
nativeSymbols option is on by default:
- Release build types get
ndk.debugSymbolLevel = "FULL"unless they set it, so the libraries in the app are stripped, and their debug information is kept in the build’s output. - After the build, the plugin uploads with
apsio upload ndkthe unstripped copy of each library the app packages that has symbols. Debug information gives functions, files and lines; a symbol table alone (a library built without-g) gives function names. A library that was already stripped before the build has nothing to upload. A.so.dbgyour build adds to AGP’s native debug metadata is uploaded instead of its library. - The upload goes under the build id the plugin writes into the manifest, next to the
R8 mapping, and uses the token in
APSIO_TOKEN, as the mapping does.
With the CLI
From a build script or CI, after the build:- The directory (here
native-debug-symbols) holds one subdirectory per ABI,arm64-v8a,armeabi-v7a,x86,x86_64andriscv64, with the libraries’ ELF files that have debug information: the.so.dbgfiles ofdebugSymbolLevel = "FULL"(AGP also zips them, in this layout, intoapp/build/outputs/native-debug-symbols/<variant>/native-debug-symbols.zipfor Google Play: unzip it and pass the folder), or unstripped.sofiles. - Each file is uploaded under its GNU build id, the id native crashes carry, with its ABI and the library’s name. A file that is not ELF, has no build id, has no symbols (a stripped library) or belongs to another ABI is skipped with a warning.
--build-idis the build id in the app’s manifest, the one its R8 mapping uses (see Give the build an id). Apsio records which libraries that build ships.- A library Apsio already has is not sent again: a library you did not change keeps its
build id across builds.
--forceuploads everything again.--dry-runchecks the files without a token or an upload, and--jsonprints a report. - The command succeeds when every library was uploaded or Apsio had it already. When any upload fails it exits with an error (4 when the server rejected the files, 1 for network or server errors), after uploading the others, so a build that treats upload errors as failures stops.
-Wl,--build-id). A library without one cannot be matched to its crashes.
Libraries from dependencies
A library an AAR dependency ships (a vendor’s SDK) is part of the app like your own, so without its debug file it shows under the release’s missing symbols ("kind": "native_library").
- When the dependency ships it with debug information or a symbol table, the plugin uploads it with your own libraries: nothing to do. With a symbol table alone, its frames get function names but no files or lines.
- When the vendor ships it stripped, there is nothing to upload. Ask the vendor for the
unstripped
.soor its.so.dbgfor the version you ship, and upload it withapsio upload ndkunder the build’s id. Without it, the library’s frames keep the names the device gives (its exported functions) and still group.
ndkVersion, or its default when you
set none, installed in the Android SDK. Without one it packages the libraries as they are,
with their debug information, so the app is larger; the plugin still uploads their symbols.
When a native crash stays unsymbolicated
- The build’s debug files were never uploaded, or come from another build: a rebuild of the same code can produce other build ids.
- The library was linked without a build id.
- The frame is in a library of the system (
libc.so,libart.so): those keep the function name the device gives and are never listed as missing.