Android ActivityThread.reportSizeConfigurations causes app to freeze with black screen and then crash

余生颓废 提交于 2019-11-29 20:09:43
Ian Wong

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

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

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.

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

There is a bug opened with Google, seems exclusive to Samsung on app upgrades

https://issuetracker.google.com/issues/62427912

One of reasons of this problem can be - memory leak. In Houde's blog he writes the app that uses EventBus to receive the event to close the Activity, and an Event was writing an internal class, that caused by a memory leak.

Memory leak causes activity not no launch but relaunch. That causes problem by his words.

Another problem could be Activity pause/stop/destroy timeout. It can lead to the same

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!