Android 应用程序在没有堆栈的情况下崩溃:如何调试?

Android app crashed without stack : how to debug?

我正在我的 Samsung Note 8 上测试 Google Mobile Vision 库,有时,我的应用程序崩溃并显示 A/libc: Fatal signal 11,但根本没有堆栈跟踪,即使 运行 android 工作室调试器。 我只有 :

...V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@ed7d6d6 nm : info.lapouyade.dcinventory ic=null
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
D/OpenGLRenderer: eglDestroySurface = 0x793081d8c0
                  endAllActiveAnimators on 0x79291bcc00 (RippleDrawable) with handle 0x791d701b60
D/ViewRootImpl@dc5d321[MainActivity]: Relayout returned: old=[0,0][1440,2960] new=[0,0][1440,2960] result=0x5 surface={valid=false 0} changed=true
D/ViewRootImpl@10d3d9f[BarcodeToFieldActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1440, 2960) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
I/zygote64: Do partial code cache collection, code=117KB, data=84KB
            After code cache collection, code=117KB, data=84KB
            Increasing code cache capacity to 512KB
I/zygote64: Compiler allocated 8MB to compile void android.view.ViewRootImpl.performTraversals()
I/zygote64: Do full code cache collection, code=251KB, data=178KB
            After code cache collection, code=173KB, data=115KB
I/zygote64: Do partial code cache collection, code=250KB, data=164KB
            After code cache collection, code=250KB, data=164KB
            Increasing code cache capacity to 1024KB
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xc in tid 1705 (Thread-4)
Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'

没有例外,所以我什么也抓不到:如何在这种崩溃中获取堆栈?

尝试将整个 stack trace 打印到 logcat.txt 文件

您可以使用来自 Android Studio 终端的命令

Please make sure before using this that you have already set the adb path to your System Variable to use it Globally.

adb logcat -> logcat.txt  

发生崩溃后,您可以检查此 logcat.txt 文件以获取确切错误。

上周,我也遇到了同样的问题,但通过这种方式我能够捕捉到整个场景。
希望这对你有帮助