The NDK package includes a set of documentation that describes the capabilities of the NDK and how to use it to create shared libraries for your Android applications. In this release, the documentation is provided only in the downloadable NDK package. The Android NDK is a toolset that lets you implement parts of your app in native code, using languages such as C and C. For certain types of apps, this can help you reuse code libraries written in.
Android NDK allows you to implement parts of your Android apps using C and C++. You can use the Google Breakpad client library for your Android apps to receive valid stack traces in native code. The stack traces may only contain memory addresses. They don’t show class names, methods, file names, and line numbers which are needed to read and understand the crashes. To get the memory addresses translated for your Android NDK app, you must upload application symbols for each build.
To learn how to report NDK crashes, refer to the Android SDK documentation for Android apps, or Unity SDK documentation for Unity apps.
If you want to send Breakpad crashes from other platforms to App Center, see the upload custom crashes documentation.
Unsymbolicated crashes
Unsymbolicated crashes are displayed in the App Center Diagnostics section so you can view some details even before uploading symbols. The missing symbols from these crashes will be shown in the 'unsymbolicated' tab. If the missing symbols are uploaded, the unsymbolicated crash group will be replaced by a symbolicated crash group.
Note
App Center doesn't support symbolication of frames which come from system libraries.Given the high fragmentation of system binaries for Android and other platforms – which might be different on any given device/OS version combination – App Center doesn't provide symbols itself for system binaries and automatically skips frames from system binaries in symbolication.
Generate a .zip file to upload
There are two ways for App Center to retrieve the symbols necessary for symbolication. App Center can generate them from the native binaries used in your project, or you can upload the Breakpad symbols directly.
Option 1: Upload native binaries
Put all .so files from the project's obj/local/$ABI/
directory into a .zip file.
Option 2: Upload Breakpad symbols
- Dump the symbols using the Breakpad toolchain as described in the Breakpad documentation under section 'Get the debugging symbols'.
- Create a symbols.zip file with the following structure:
Note
If you're uploading your symbols from macOS, then you must clean your symbols of any extraneous folders, e.g. __MACOS gets generated and to delete this you can use zip -d <symbols.zip> __MACOSX/*
.
Uploading symbols
Note
The App Center Build and Distribution service can automatically forward symbols to the Diagnostics service. If you use App Center to build and auto distribute your app to your end users, you don't need to manually obtain and upload the symbol files as detailed in the steps below.
App Center Portal
- Log into App Center and select your app.
- In the left menu, navigate to the Diagnostics section, then Issues.
- If your application hasn't reported any crash yet, you'll need to use the API or CLI to upload Breakpad symbols.
- If your application already has reported crashes that need symbols, check the Unsymbolicated tab and there should be a version group with missing symbols, click on it to reveal the menu to upload the file.
- After the symbols are indexed by App Center, crashes will be symbolicated for you.
App Center API
The process for uploading symbols through the API involves a series of three API calls: one to allocate space on our backend, one to upload the file, and one to update the status of the upload. The body of the first API call should set symbol_type
to Breakpad
.
- Trigger a
POST
request to the symbol_uploads API.This call allocates space on our backend for your file and returns asymbol_upload_id
and anupload_url
property.
- Using the
upload_url
property returned from the first step, make aPUT
request with the header:'x-ms-blob-type: BlockBlob'
and supply the location of your file on disk. This call uploads the file to our backend storage accounts. Learn more about PUT Blob request headers .
- Make a
PATCH
request to the symbol_uploads API using thesymbol_upload_id
property returned from the first step. In the body of the request, specify whether you want to set the status of the upload tocommitted
(successfully completed) the upload process, oraborted
(unsuccessfully completed).
Note
Android Ndk Cmake
The symbol uploads API doesn't work for files that are larger than 256MB. Use the App Center CLI to upload these files. You can install the App Center CLI by following the instructions in our App Center CLI repo.
App Center CLI
You can also use the CLI to upload symbol files:
Ignoring symbols
Android Ndk Sample
When App Center doesn't have all the symbol files to fully symbolicate crash reports, the crashes are listed in the Unsymbolicated tab. The required symbols are uploaded from this page if you have access to them.
Android Ndk 17
If you can't upload the symbols, you can mark them as Ignored by selecting rows in the table and clicking the Ignore versions button. This button tells App Center to process the crashes and symbolicate them as fully as possible with the symbols on file. Once they've finished processing, they'll appear in the Crashes tab partially symbolicated. New crashes that also depend on those same symbol IDs marked as ignored will bypass the Unsymbolicated tab as they come in and flow through the system.