代码之家  ›  专栏  ›  技术社区  ›  Eric

Android应用程序无堆栈崩溃:如何调试?

  •  1
  • Eric  · 技术社区  · 6 年前

    我正在我的三星Note8上测试谷歌移动视觉库,我的应用程序不时会因为一个错误而崩溃 A/libc: Fatal signal 11 ,但根本没有堆栈跟踪,即使在使用androidstudio调试器运行时也是如此。 我只有:

    ...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'
    

    没有例外,所以我什么都抓不到:如何在这样的崩溃中获得堆栈?

    1 回复  |  直到 6 年前
        1
  •  3
  •   Abhinav Suman    6 年前

    试着把整个 stack trace logcat.txt 文件

    您可以使用 Android Studio 终端

    adb 全局使用系统变量的路径。

    adb logcat -> logcat.txt  
    

    崩溃发生后,你可以检查这个 文件以获取确切的错误。

    上周,我也面临着同样的问题,但这样我就能够捕捉到整个场景。