java Android:如何读取不指定代码行的堆栈跟踪
我的应用程序用户报告错误,导致他们的堆栈跟踪显示在Google Play开发者控制台中。但问题是,这些日志/跟踪中有几个不包含有关我的应用程序特定代码的信息。 下面是一个例子:
backtrace:
native: pc 0000000000069340 /system/lib64/libc.so (tgkill+8)
native: pc 0000000000066ad0 /system/lib64/libc.so (pthread_kill+68)
native: pc 0000000000023910 /system/lib64/libc.so (raise+28)
native: pc 000000000001e240 /system/lib64/libc.so (abort+60)
native: pc 000000000000cf04 /system/lib64/libcutils.so (__安卓_log_assert+236)
native: pc 000000000002c238 /system/lib64/libhwui.so
native: pc 00000000000288b8 /system/lib64/libhwui.so
native: pc 000000000002ae34 /system/lib64/libhwui.so
native: pc 000000000002f374 /system/lib64/libhwui.so (_ZN7安卓10uirenderer12renderthread12RenderThread10threadLoopEv+124)
native: pc 00000000000169b4 /system/lib64/libutils.so (_ZN7安卓6Thread11_threadLoopEPv+208)
native: pc 00000000000953c0 /system/lib64/lib安卓_runtime.so (_ZN7安卓14AndroidRuntime15javaThreadShellEPv+96)
native: pc 0000000000016204 /system/lib64/libutils.so
native: pc 0000000000065f20 /system/lib64/libc.so (_ZL15__pthread_startPv+52)
native: pc 000000000001edec /system/lib64/libc.so (__start_thread+16)
这是来自一个星系S6。 类似地,请参见以下跟踪:
java.lang.OutOfMemoryError:
at java.lang.Thread.nativeCreate(Native Method:0)
at java.lang.Thread.start(Thread.java:1063)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:921)
at java.util.concurrent.ThreadPoolExecutor.processWorkerExit(ThreadPoolExecutor.java:989)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1131)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
这也是来自Galaxy S6。 以下两个来自Galaxy Tab4 7.0:
java.lang.RuntimeException:
at 安卓.view.ViewRootImpl.setView(ViewRootImpl.java:741)
at 安卓.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:278)
at 安卓.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at 安卓.widget.PopupWindow.invokePopup(PopupWindow.java:1067)
at 安卓.widget.PopupWindow.showAsDropDown(PopupWindow.java:966)
at 安卓.support.v7.widget.AppCompatPopupWindow.showAsDropDown(AppCompatPopupWindow.java:105)
at 安卓.support.v4.widget.PopupWindowCompatKitKat.showAsDropDown(PopupWindowCompatKitKat.java:33)
at 安卓.support.v4.widget.PopupWindowCompat$KitKatPopupWindowImpl.showAsDropDown(PopupWindowCompat.java:129)
at 安卓.support.v4.widget.PopupWindowCompat.showAsDropDown(PopupWindowCompat.java:206)
at 安卓.support.v7.widget.ListPopupWindow.show(ListPopupWindow.java:721)
at 安卓.support.v7.view.menu.StandardMenuPopup.tryShow(StandardMenuPopup.java:160)
at 安卓.support.v7.view.menu.StandardMenuPopup.show(StandardMenuPopup.java:187)
at 安卓.support.v7.view.menu.MenuPopupHelper.showPopup(MenuPopupHelper.java:290)
at 安卓.support.v7.view.menu.MenuPopupHelper.tryShow(MenuPopupHelper.java:175)
at 安卓.support.v7.widget.ActionMenuPresenter$OpenOverflowRunnable.run(ActionMenuPresenter.java:803)
at 安卓.os.Handler.handleCallback(Handler.java:733)
at 安卓.os.Handler.dispatchMessage(Handler.java:95)
at 安卓.os.Looper.loop(Looper.java:146)
at 安卓.app.ActivityThread.main(ActivityThread.java:5602)
at java.lang.reflect.Method.invokeNative(Native Method:0)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.安卓.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.安卓.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method:0)
Caused by: 安卓.os.TransactionTooLargeException:
at 安卓.os.BinderProxy.transact(Native Method:0)
at 安卓.view.IWindowSession$Stub$Proxy.addToDisplay(IWindowSession.java:710)
at 安卓.view.ViewRootImpl.setView(ViewRootImpl.java:730)
及
java.lang.RuntimeException:
at 安卓.view.ViewRootImpl.setView(ViewRootImpl.java:741)
at 安卓.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:278)
at 安卓.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at 安卓.widget.Toast$TN.handleShow(Toast.java:478)
at 安卓.widget.Toast$TN$1.run(Toast.java:374)
at 安卓.os.Handler.handleCallback(Handler.java:733)
at 安卓.os.Handler.dispatchMessage(Handler.java:95)
at 安卓.os.Looper.loop(Looper.java:146)
at 安卓.app.ActivityThread.main(ActivityThread.java:5602)
at java.lang.reflect.Method.invokeNative(Native Method:0)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.安卓.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.安卓.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method:0)
Caused by: 安卓.os.TransactionTooLargeException:
at 安卓.os.BinderProxy.transact(Native Method:0)
at 安卓.view.IWindowSession$Stub$Proxy.addToDisplay(IWindowSession.java:710)
at 安卓.view.ViewRootImpl.setView(ViewRootImpl.java:730)
所有这些都来自三星设备。我无法在Nexus 5上重现这些错误,其他设备用户也无法报告这些问题。我怎么知道是什么原因导致了车祸
我有一个线索,但这也只发生在三星。我有以下代码:
private class ListOldFiles extends AsyncTask<String, Integer, Boolean> {
@Override
protected Boolean doInBackground(String... strings) {
ArrayList<String> filesList = loadOrderedCollection(FILES_LIST_KEY);
// loads JSON from SharedPreferences and converts it into ArrayList.
for (String path : filesList) {
if (isCancelled())
return false;
itemList.add(new Item(path));
publishProgress();
}
return true;
}
@Override
protected void onProgressUpdate(Integer... values) {
itemArrayAdapter.notifyDataSetChanged();
super.onProgressUpdate(values);
}
@Override
protected void onPostExecute(Boolean shouldContinue) {
if (shouldContinue)
listAllFiles = new ListAllFiles().execute();
super.onPostExecute(shouldContinue);
}
}
在这段代码中,设备(三星)在
listAllFiles = new ListAllFiles().execute();
共 (0) 个答案