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

Android应用程序在没有堆栈的情况下崩溃:如何调试?,android,google-vision,Android,Google Vision,我正在三星Note 8上测试Google Mobile Vision library,我的应用程序不时会出现a/libc:Fatal signal 11,但根本没有堆栈跟踪,即使在使用android studio调试器运行时也是如此。 我只得到: ...V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@ed7d6d6 nm : info.lapouyade.dcinventory ic=nu

我正在三星Note 8上测试Google Mobile Vision library,我的应用程序不时会出现
a/libc:Fatal signal 11
,但根本没有堆栈跟踪,即使在使用android studio调试器运行时也是如此。 我只得到:

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

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

尝试通过将其打印到
logcat.txt
文件来获取整个
堆栈跟踪

您可以使用Android Studio中的命令

使用前请确保您已经设置了
adb
全局使用系统变量的路径

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

上周,我也面临同样的问题,但通过这种方式,我能够捕捉整个场景。

希望这对您有所帮助

您有权访问libc代码吗?信号11(SIGSEGV)表示本机代码中存在问题。你使用一些本机库吗?你有本机崩溃的第一行。剩下的应该在logcat中就在它的正下方。我使用了android studio中的logcat,它似乎比adb logcat要简单得多。adb logcat就是解决方案。我已经从Android studio检查了logcat窗口,但没有发现堆栈。可能我错过了什么,我会尝试你的方式…同时,验证你已经启用了NDK的调试。
adb logcat -> logcat.txt