我注意到我的应用程序会得到一个ANR并且会在那里挂起,直到我强制关闭应用程序。我在主线程上没有做任何事情。我正在使用第三方视频播放器SDK,我相信它可能与此有关。我在logcat中得到了这个:
Skipped 46 frames! The application may be doing too much work on its main thread.
当手机进入ANR状态时,我也可以从手机上获取traces.txt。我不确定我应该寻找什么,但这是traces.txt中的主要线程。有没有人在这看到任何错误?
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x4162ee40 self=0x4154f828
| sysTid=974 nice=-2 sched=0/0 cgrp=apps handle=1073942868
| state=S schedstat=( 0 0 0 ) utm=14100 stm=9716 core=0
#00 pc 00021814 /system/lib/libc.so (epoll_wait+12)
#01 pc 0001064f /system/lib/libutils.so (android::Looper::pollInner(int)+98)
#02 pc 00010879 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
#03 pc 0006aa9d /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
#04 pc 0002034c /system/lib/libdvm.so (dvmPlatformInvoke+112)
#05 pc 00050e6b /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
#06 pc 000297e0 /system/lib/libdvm.so
#07 pc 00030ae8 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#08 pc 0002e180 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
#09 pc 00063751 /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+392)
#10 pc 0006b713 /system/lib/libdvm.so
#11 pc 000297e0 /system/lib/libdvm.so
#12 pc 00030ae8 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#13 pc 0002e180 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
#14 pc 0006346d /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
#15 pc 0004ca37 /system/lib/libdvm.so
#16 pc 0004d0f7 /system/lib/libandroid_runtime.so
#17 pc 0004de1b /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*)+354)
#18 pc 0000105b /system/bin/app_process
#19 pc 0000e41b /system/lib/libc.so (__libc_init+50)
#20 pc 00000d7c /system/bin/app_process
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:138)
at android.os.Looper.loop(Looper.java:123)
at com.android.server.ServerThread.initAndLoop(SystemServer.java:1247)
at com.android.server.SystemServer.main(SystemServer.java:1412)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)