gpt4 book ai didi

Android ActivityThread.reportSizeConfigurations 导致应用程序卡住并黑屏然后崩溃

转载 作者:IT老高 更新时间:2023-10-28 21:37:43 26 4
gpt4 key购买 nike

我的应用程序崩溃了。它发生在很多用户及其在 ActivityThread.java 方法 reportSizeConfigurations 中的多个位置。我不知道这是做什么用的,为什么会卡住。

卡住发生在初始屏幕之后(主要 Activity 启动时),并且仅在应用升级时发生。如果您重新安装应用程序,问题就会消失。问题是,我不能告诉所有用户重新安装应用程序...

有谁知道这可能是什么原因,为什么?它似乎可能与一些数据库处理有关,但这只是一个猜测。

这是来自 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 商店“ANR 和崩溃”的堆栈跟踪:

    "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)

如果您需要更多信息,请告知

最佳答案

崩溃是由您的服务上的 ANR 引起的,在您的 Activity 启动之前。

如果用户在服务中的长时间运行任务期间启动您的应用,则在服务上的任务完成之前不会创建 Activity。这种等待对于启动您的应用的用户来说可能看起来很奇怪,然后他们在任务切换器中滑动您的应用,这会从 ActivityManager 中删除任务记录(但此时进程仍然保持 Activity 状态)。

当服务上长时间运行的任务最终返回时,它会解除对Activity启动的阻塞,但此时Activity会抛出ActivityRecord not found异常,因为它已经被移除了。

以下序列图可能更好地解释崩溃。 enter image description here

感谢 YogiAi,他最初在 this post 中调查了该问题。 .

关于Android ActivityThread.reportSizeConfigurations 导致应用程序卡住并黑屏然后崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46309428/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com