How to Add debug symbols to build.gradle

22 May 2022

Home » Blogs » Android » How to Add debug symbols to build.gradle

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

If you get this error when uploading your app to the Play Console, you need to add a 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.
TOP TUTORIALS:  How to Uninstall Windows 10 Updates
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:  Script Insert Thousands of Random Data into MySQL
check ndk version

3. Generate debug symbol in build.gradle

To add debug symbols to your , 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 file has a maximum limit of 300 MB.

4. Build Bundle/APK

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

TOP TUTORIALS:  LanSpy – Network security and port scanner

If you choose to compile your in the format:

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

0 Comments

Submit a Comment