Android ActivityThread.reportSizeConfigurations导致应用程序冻结并出现黑屏,然后崩溃 [英] Android ActivityThread.reportSizeConfigurations causes app to freeze with black screen and then crash

查看:2162
本文介绍了Android ActivityThread.reportSizeConfigurations导致应用程序冻结并出现黑屏,然后崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用崩溃.它发生在ActivityThread.java方法reportSizeConfigurations中的许多用户及其多个位置.我不知道它的用途是什么,为什么会冻结.

I have a crash in my app. It happens for a lot of users and its multiple places in ActivityThread.java method reportSizeConfigurations. I dont know what this is used for, and why it freezes.

冻结会在启动屏幕之后(启动主要活动时)立即发生,并且仅在应用程序升级时发生.如果您重新安装该应用程序,问题将消失.问题是,我无法告诉所有用户重新安装该应用程序...

The freeze happens right after the splash screen (when the main activity is started) and is only happening on upgrading of the app. If you reinstall the application the problem goes away. Problem is, I cant tell all the users to reinstall the application...

有人知道这可能是什么原因吗?为什么?似乎可能与某些数据库处理有关,但这仅是一个猜测.

Does anyone know what might cause this and why? It seems maybe to be connected with some DB handling, but thats just a guess.

在这里从Crashlytics获取堆栈跟踪:

Heres the stacktrace from Crashlytics:

Fatal Exception: java.lang.IllegalArgumentException: reportSizeConfigurations: ActivityRecord not found for: Token{a28a055 null}
   at android.os.Parcel.readException(Parcel.java:1697)
   at android.os.Parcel.readException(Parcel.java:1646)
   at android.app.ActivityManagerProxy.reportSizeConfigurations(ActivityManagerNative.java:8342)
   at android.app.ActivityThread.reportSizeConfigurations(ActivityThread.java:3049)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2992)
   at android.app.ActivityThread.-wrap14(ActivityThread.java)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:154)
   at android.app.ActivityThread.main(ActivityThread.java:6682)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

从Play商店'ANRs&崩溃":

Heres the stacktrace from play store 'ANRs & crashes':

    "main" prio=5 tid=1 TimedWaiting
  | group="main" sCount=1 dsCount=0 obj=0x74864f70 self=0x7f8b896a00
  | sysTid=28578 nice=0 cgrp=default sched=0/0 handle=0x7f8f832a98
  | state=S schedstat=( 237746089 66838748 1069 ) utm=18 stm=5 core=6 HZ=100
  | stack=0x7fcdbf9000-0x7fcdbfb000 stackSize=8MB
  | held mutexes=

  at java.lang.Object.wait! (Native method)
- waiting on <0x0c54fb7b> (a java.lang.Object)
  at java.lang.Thread.parkFor$ (Thread.java:2127)
- locked <0x0c54fb7b> (a java.lang.Object)
  at sun.misc.Unsafe.park (Unsafe.java:325)
  at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:201)
  at android.database.sqlite.SQLiteConnectionPool.waitForConnection (SQLiteConnectionPool.java:670)
  at android.database.sqlite.SQLiteConnectionPool.acquireConnection (SQLiteConnectionPool.java:348)
  at android.database.sqlite.SQLiteSession.acquireConnection (SQLiteSession.java:894)
  at android.database.sqlite.SQLiteSession.prepare (SQLiteSession.java:586)
  at android.database.sqlite.SQLiteProgram.<init> (SQLiteProgram.java:58)
  at android.database.sqlite.SQLiteQuery.<init> (SQLiteQuery.java:37)
  at android.database.sqlite.SQLiteDirectCursorDriver.query (SQLiteDirectCursorDriver.java:44)
  at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory (SQLiteDatabase.java:1318)
  at android.database.sqlite.SQLiteQueryBuilder.query (SQLiteQueryBuilder.java:399)
  at android.database.sqlite.SQLiteQueryBuilder.query (SQLiteQueryBuilder.java:294)
  at com.norwegian.travelassistant.managers.storagemanager.StorageManager.query (StorageManager.java:1011)
  at com.norwegian.travelassistant.managers.storagemanager.StorageManager.a (StorageManager.java:1218)
- locked <0x00f0bd98> (a java.lang.Object)
  at com.norwegian.travelassistant.managers.storagemanager.StorageManager.a (StorageManager.java:1205)
  at com.norwegian.travelassistant.managers.storagemanager.StorageManager.F (StorageManager.java:1812)
  at com.norwegian.travelassistant.managers.e.a (LanguageManager.java:63)
  at com.norwegian.travelassistant.managers.e.a (LanguageManager.java:84)
  at com.norwegian.travelassistant.tabbar.TabsActivity.onCreate (TabsActivity.java:141)
  at android.app.Activity.performCreate (Activity.java:6705)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1119)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2664)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2772)
  at android.app.ActivityThread.-wrap12 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1515)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:241)
  at android.app.ActivityThread.main (ActivityThread.java:6217)
  at java.lang.reflect.Method.invoke! (Native method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:865)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:755)

请告知您是否需要更多信息

Please tell if you need more info

推荐答案

崩溃是由启动活动"之前服务上的ANR引起的.

The crash is caused by the ANR on your Service, prior to the launch of your Activity.

如果用户在服务中一项长期运行的任务中启动了您的应用,则直到该服务中的任务完成后才创建活动.对于用户启动您的应用程序来说,这种等待可能看起来很奇怪,然后他们在任务切换器中将您的应用程序滑开,这会从ActivityManager中删除任务记录(但此时程序仍处于活动状态).

If a user launches your app during a long-running task in your Service, the Activity will not be created until the task on the service finishes. This waiting might look bizarre to the user launching your app, and they then swipe your app away in the task switcher, which removes the task record from the ActivityManager (but process is still kept alive at this time).

当服务上长期运行的任务最终返回时,它将阻止活动启动,但是此时活动将抛出ActivityRecord not found异常,因为它已被删除.

When the long-running task on the service finally returns, it unblocks the activity from launching, but at this time the activity will throw ActivityRecord not found exception because it was removed already.

以下序列图可能会更好地解释崩溃.

The following sequence diagram might explain the crash better.

信用归YogiAi负责,后者最初在此帖子中对此问题进行了调查.

Credit goes to YogiAi, who originally investigated the issue in this post.

这篇关于Android ActivityThread.reportSizeConfigurations导致应用程序冻结并出现黑屏,然后崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆