-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add native debug symbols doc for Android #11435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
syntaxerror247
wants to merge
1
commit into
godotengine:master
Choose a base branch
from
syntaxerror247:debug-symbols
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+83
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
tutorials/platform/android/resolving_crashes_on_android.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| .. _doc_resolving_crashes_on_android: | ||
|
|
||
| Resolving crashes on Android | ||
| ============================ | ||
|
|
||
| When your game crashes on Android, you often see obfuscated stack traces in Play Console | ||
| or other crash reporting tools like Firebase Crashlytics. To make these stack traces human-readable (symbolicated), | ||
| you need native debug symbols that correspond to your game's exported build. | ||
|
|
||
| Godot now provides downloadable native debug symbols for each official export template. | ||
|
|
||
| Getting Native Debug symbols for official templates | ||
| --------------------------------------------------- | ||
|
|
||
| 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/>`_. | ||
|
|
||
| For example, to get the native debug symbols for version ``4.5.1.stable``: | ||
|
|
||
| - Go to the `4.5.1.stable release page <https://github.com/godotengine/godot/releases/>`_ | ||
| - Download the release artifact ``Godot_native_debug_symbols.4.5.1.stable.template_release.android.zip`` | ||
|
|
||
| Getting Native Debug symbols for custom builds | ||
| ---------------------------------------------- | ||
|
|
||
| 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**. | ||
| If you are building **custom export templates**, you need to generate matching symbol files yourself. | ||
|
|
||
| To do so, add ``debug_symbols=yes separate_debug_symbols=yes`` to your scons build command. | ||
| This will generate a file named ``android-template-release-native-symbols.zip`` containing the native debug symbols for your custom build. | ||
|
|
||
| For example, | ||
|
|
||
| :: | ||
|
|
||
| scons platform=android target=template_release debug_symbols=yes separate_debug_symbols=yes generate_android_binaries=yes | ||
|
|
||
| If you are building for multiple architectures, you should include the ``separate_debug_symbols=yes`` only in the last build command, | ||
| similar to how ``generate_android_binaries=yes`` is used. | ||
|
|
||
| :: | ||
|
|
||
| scons platform=android arch=arm32 target=template_release debug_symbols=yes | ||
| scons platform=android arch=arm64 target=template_release debug_symbols=yes | ||
| scons platform=android arch=x86_32 target=template_release debug_symbols=yes | ||
| scons platform=android arch=x86_64 target=template_release debug_symbols=yes separate_debug_symbols=yes generate_android_binaries=yes | ||
|
|
||
| Uploading Symbols to Google Play Console | ||
| ---------------------------------------- | ||
|
|
||
| Follow these steps to upload the native debug symbols: | ||
|
|
||
| 1. Open `Play Console <https://play.google.com/console>`_. | ||
| 2. Select any app. | ||
| 3. In the left menu, navigate to ``Test and release > Latest releases and bundles``. | ||
| 4. Now choose the relevant bundle and open it. | ||
| 5. Select the ``Downloads`` tab, and scroll down to the ``Assets`` section. | ||
| 6. Next to ``Native debug symbols``, click the upload arrow icon. | ||
| 7. Select and upload the corresponding native debug symbols file for that build version. | ||
|
|
||
| Alternatively, you can upload the symbols when creating a new release: | ||
|
|
||
| 1. On the Create release page, locate your new release bundle. | ||
| 2. Click the three-dot menu beside it. | ||
| 3. Choose ``Upload native debug symbols (.zip)`` from the menu. | ||
| 4. Select and upload the corresponding native debug symbols file for that build version. | ||
|
|
||
| Manually Symbolicating Crash Logs | ||
| --------------------------------- | ||
|
|
||
| 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. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should include instructions for how to download and access the |
||
|
|
||
| 1. Extract the native debug symbols zip you downloaded earlier (or generated with your custom build). | ||
| 2. Save your crash log to a text file (for example, ``crash.txt``). | ||
| 3. Run ndk-stack with the path to the symbol directory that matches the crash's CPU architecture (for example, ``arm64-v8a``): | ||
|
|
||
| :: | ||
|
|
||
| ndk-stack -sym path/to/native_debug_symbols/arm64-v8a/ -dump crash.txt | ||
|
|
||
| 4. The output will display a symbolicated trace, showing file names and line numbers in Godot's source code (or your custom build). | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.