对 Unity 游戏的 Android 崩溃和 ANR 问题进行符号化解析
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Android 上的崩溃和 ANR 问题会生成堆栈轨迹,这是您的游戏在崩溃之前调用过的嵌套函数序列的快照。这些快照可帮助您找出并修正源代码中的任何问题。
不过,当您在发布模式下使用 Unity 构建游戏时,符号不会随 APK 一起打包。如果您的游戏崩溃或出现 ANR 问题,调用堆栈将仅显示内存地址。
例如:
05-26 18:06:51.311: A/libc(26986): Fatal signal 11 (SIGSEGV) at 0x000004e4 (code=1), thread 27024 (Worker Thread)
05-26 18:06:51.411: I/DEBUG(242): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-26 18:06:51.411: I/DEBUG(242): Build fingerprint: 'Xiaomi/cancro_wc_lte/cancro:4.4.4/KTU84P/V6.7.1.0.KXDCNCH:user/release-keys'
05-26 18:06:51.411: I/DEBUG(242): Revision: '0'
05-26 18:06:51.411: I/DEBUG(242): pid: 26986, tid: 27024, name: Worker Thread >>> com.u.demo <<<
05-26 18:06:51.411: I/DEBUG(242): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 000004e4
I/DEBUG(242): backtrace:
I/DEBUG(242): #00 pc 006d4960 /data/app-lib/com.u.demo-1/libunity.so
I/DEBUG(242): #01 pc 006d4c0c /data/app-lib/com.u.demo-1/libunity.so
I/DEBUG(242): #02 pc 006d4c0c /data/app-lib/com.u.demo-1/libunity.so
I/DEBUG(242): #03 pc 006d4c0c /data/app-lib/com.u.demo-1/libunity.so
I/DEBUG(242): #04 pc 006d4c0c /data/app-lib/com.u.demo-1/libunity.so
I/DEBUG(242): #05 pc 001c5510 /data/app-lib/com.u.demo-1/libunity.so
I/DEBUG(242): #06 pc 001c595c /data/app-lib/com.u.demo-1/libunity.so
I/DEBUG(242): #07 pc 001c4ec0 /data/app-lib/com.u.demo-1/libunity.so
I/DEBUG(242): #08 pc 0043a05c /data/app-lib/com.u.demo-1/libunity.so
I/DEBUG(242): #09 pc 0000d248 /system/lib/libc.so (__thread_entry+72)
I/DEBUG(242): #10 pc 0000d3e0 /system/lib/libc.so (pthread_create+240)
Google Play 支持在 Play 管理中心为每个应用版本上传调试符号文件。这样可以更轻松地分析并修正崩溃和 ANR 问题。
从 Unity 2020.3 及更高版本开始,您可以按照 Unity 的指南生成
Android 符号
然后将符号化解析文件上传到 Google
在 Play 管理中心查看 Android Vitals 中直观易懂的堆栈轨迹
信息中心。
否则,您可以按照 Unity 中的对 Android 崩溃进行符号化解析一文,手动解析堆栈轨迹或为较低版本的 Unity 生成符号文件。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Symbolicate Android crashes and ANR for Unity games\n\nCrashes and ANRs on Android produce a stack trace, which is a snapshot of the\nsequence of nested functions called in your game up to the moment it crashed.\nThese snapshots can help you identify and fix any problems in the source.\n\nHowever, when you build your game with Unity in release mode, the symbols are\nnot packed with the APK. If your game crashes or has ANRs, the call stack only\nshows the memory address.\n\nFor example:\n\u003e\n\u003e 05-26 18:06:51.311: A/libc(26986): Fatal signal 11 (SIGSEGV) at 0x000004e4 (code=1), thread 27024 (Worker Thread)\n\u003e 05-26 18:06:51.411: I/DEBUG(242): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n\u003e 05-26 18:06:51.411: I/DEBUG(242): Build fingerprint: 'Xiaomi/cancro_wc_lte/cancro:4.4.4/KTU84P/V6.7.1.0.KXDCNCH:user/release-keys'\n\u003e 05-26 18:06:51.411: I/DEBUG(242): Revision: '0'\n\u003e 05-26 18:06:51.411: I/DEBUG(242): pid: 26986, tid: 27024, name: Worker Thread \u003e\u003e\u003e com.u.demo \u003c\u003c\u003c\n\u003e 05-26 18:06:51.411: I/DEBUG(242): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 000004e4\n\u003e I/DEBUG(242): backtrace:\n\u003e I/DEBUG(242): #00 pc 006d4960 /data/app-lib/com.u.demo-1/libunity.so\n\u003e I/DEBUG(242): #01 pc 006d4c0c /data/app-lib/com.u.demo-1/libunity.so\n\u003e I/DEBUG(242): #02 pc 006d4c0c /data/app-lib/com.u.demo-1/libunity.so\n\u003e I/DEBUG(242): #03 pc 006d4c0c /data/app-lib/com.u.demo-1/libunity.so\n\u003e I/DEBUG(242): #04 pc 006d4c0c /data/app-lib/com.u.demo-1/libunity.so\n\u003e I/DEBUG(242): #05 pc 001c5510 /data/app-lib/com.u.demo-1/libunity.so\n\u003e I/DEBUG(242): #06 pc 001c595c /data/app-lib/com.u.demo-1/libunity.so\n\u003e I/DEBUG(242): #07 pc 001c4ec0 /data/app-lib/com.u.demo-1/libunity.so\n\u003e I/DEBUG(242): #08 pc 0043a05c /data/app-lib/com.u.demo-1/libunity.so\n\u003e I/DEBUG(242): #09 pc 0000d248 /system/lib/libc.so (__thread_entry+72)\n\u003e I/DEBUG(242): #10 pc 0000d3e0 /system/lib/libc.so (pthread_create+240)\n\nGoogle Play supports uploading a debug symbols file for each version of your app\nin Play Console. This makes it easier to analyze and fix your crashes and ANRs.\n\nFrom Unity 2020.3 and higher, you can follow Unity's guidance to generate\n[Android symbols](https://docs.unity3d.com/2020.3/Documentation/Manual/android-symbols.html)\nand then [upload the symbolication file](https://support.google.com/googleplay/android-developer/answer/9848633?#zippy=%2Cupload-files-using-play-console) to Google\nPlay Console to see a human-readable stack trace on the Android Vitals\ndashboard.\n\nOtherwise, you can follow the\n[Symbolicate Android crash](https://support.unity.com/hc/en-us/articles/115000292166-Symbolicate-Android-crash) article from\nUnity to manually resolve the stack trace or generate symbol files for lower\nversions of Unity."]]