How to Add debug symbols to build.gradle

22 May 2022

Playstore error: “ App Bundle contains native code, and you’ve not uploaded debug symbols ”.

If you get this error when uploading your app to the Google Play Console, you need to add a debug symbol to your app.

To add debug symbols to the following tutorial, you must use the Android Gradle Plugin version 4.1 and later.

1. Install NDK and CMake in Android Studio

  1. In the project that opens, click on “ Tools > SDK Manager ”.
  2. SDK Tools ” tab.
  3. Select and tick NDK (Side by side) and CMake.
install ndk cmake
  1. Click the “OK” button, a dialog box will tell you how much space the NDK package is using on the disk.
  2. Then click “OK”.
  3. When the installation is complete, click the “Finish” button.
  4. Your project automatically syncs the build files and performs the build. Resolve any errors that occur.

2. Check NDK Version

  1. Go back to “ Tools > SDK Manager > SDK Tools ”.
  2. Check “ Show Package Details ” at the bottom right of the window.
  3. Then look at the installed version.
TOP TUTORIALS:  DHCP Server Configuration with Multiple VLAN Cisco Packet Tracer
check ndk version

3. Generate debug symbol in build.gradle

To add debug symbols to your application, add the following code to the “ app > build.gradle ” file.

android {
    ndkVersion "24.0.8215888" //ndk version you are using

    buildTypes {
        release {
            ndk {
                debugSymbolLevel 'FULL' 
                //debugSymbolLevel 'SYMBOL_TABLE '

If the resulting file is too large, replace debugSymbolLevel ‘FULL’ with debugSymbolLevel ‘SYMBOL_TABLE’.

The debug symbol file has a maximum limit of 300 MB.

4. Build Bundle/APK

Then in your project in Android Studio, click “ Build > Generate Signed Bundle/APK… ”.

TOP TUTORIALS:  How to Automatically Login to Windows 11 - Bypass Login Screen

If you choose to compile your application in the format:

  • APK, debug symbol files will be created at “app\build\outputs\native-debug-symbols\release\ ”. Upload the file to the Google Play Console.
  • Android app Bundle, a debug symbol file will be created inside the “ app-release.aab ” file. You no longer need to upload a separate debug symbol file.