|
| 1 | +.. _doc_native_debug_symbols: |
| 2 | + |
| 3 | +Native Debug Symbols |
| 4 | +==================== |
| 5 | + |
| 6 | +When your game crashes on Android, you often see obfuscated stack traces in Play Console or other crash reporting tools like Firebase Crashlytics. |
| 7 | +To make these stack traces human-readable (symbolicated), you need native debug symbols that correspond to your game’s exported build. |
| 8 | + |
| 9 | +Godot now provides downloadable native debug symbols for each official export template. However, For custom template |
| 10 | +you'd have to generate those when building your template. |
| 11 | + |
| 12 | +Getting the Native Debug Symbols |
| 13 | +-------------------------------- |
| 14 | + |
| 15 | +There are two ways to obtain native debug symbols, depending on whether you are using the official export templates or building custom templates. |
| 16 | + |
| 17 | +1. Getting Native Debug symbols for Official template |
| 18 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 19 | + |
| 20 | +Native debug symbol files are provided for every stable Godot release and can be downloaded from the `GitHub release page <https://github.com/godotengine/godot/releases/>`_. |
| 21 | + |
| 22 | +For example, to get the native debug symbols for version ``4.5.1.stable``: |
| 23 | + |
| 24 | +- Go to `4.5.1.stable release page <https://github.com/godotengine/godot/releases/>`_ |
| 25 | +- Download the release artifact ``Godot_native_debug_symbols.4.5.1.stable.template_release.android.zip`` |
| 26 | + |
| 27 | +2. Getting Native Debug symbols for custom build |
| 28 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 29 | + |
| 30 | +Your exported template and its native debug symbols must come from the **same build**, so you can use the official symbols only if you are using the **official export templates**. |
| 31 | +If you are building **custom export templates**, you need to generate matching symbol files yourself. |
| 32 | + |
| 33 | +To do so, add ``debug_symbols=yes separate_debug_symbols=yes`` to your scons build command. |
| 34 | +This will generate a file named ``android-template-release-native-symbols.zip`` containing the native debug symbols for your custom build. |
| 35 | + |
| 36 | +For example, |
| 37 | + |
| 38 | +:: |
| 39 | + scons platform=android target=template_release debug_symbols=yes separate_debug_symbols=yes generate_android_binaries=yes |
| 40 | + |
| 41 | +Uploading Symbols to Google Play Console |
| 42 | +---------------------------------------- |
| 43 | + |
| 44 | +Follow these steps to upload the native debug symbols: |
| 45 | + |
| 46 | +1. Open `Play Console <https://play.google.com/console>`_. |
| 47 | +2. Select any app. |
| 48 | +3. On the left menu, navigate to ``Test and release > Latest releases and bundles``. |
| 49 | +4. Now choose the relevant bundle and open it. |
| 50 | +5. Select the ``Downloads`` tab, and scroll down to the ``Assets`` section. |
| 51 | +6. Next to ``Native debug symbols``, click the upload arrow icon. |
| 52 | +7. Select and upload the corresponding native debug symbols file for that build version. |
| 53 | + |
| 54 | +Alternatively, you can upload the symbols when creating a new release: |
| 55 | + |
| 56 | +1. On the Create release page, locate your new release bundle. |
| 57 | +2. Click the three-dot menu beside it. |
| 58 | +3. Choose ``Upload native debug symbols (.zip)`` from the menu. |
| 59 | +4. Select and upload the corresponding native debug symbols file for that build version. |
| 60 | + |
| 61 | +Manually Symbolicating Crash Logs |
| 62 | +--------------------------------- |
| 63 | + |
| 64 | +You can also symbolicate the crash logs manually using the `ndk-stack <https://developer.android.com/ndk/guides/ndk-stack>`_ tool included in the Android NDK. |
| 65 | + |
| 66 | +1. Extract the native debug symbols zip you downloaded earlier (or generated with your custom build). |
| 67 | +2. Save your crash log into a text file (for example, crash.txt). |
| 68 | +3. Run ndk-stack with the path to the symbol directory that matches the crash’s CPU architecture (for example, arm64-v8a): |
| 69 | + |
| 70 | +:: |
| 71 | + ndk-stack -sym path/to/native_debug_symbols/arm64-v8a/ -dump crash.txt |
| 72 | + |
| 73 | +4. The output will display a symbolicated trace, showing file names and line numbers in Godot’s source code (or your custom build). |
0 commit comments