wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.92k stars 1.3k forks source link

Crash report 7.2: IllegalArgumentException: reportSizeConfigurations #5821

Closed mzorz closed 5 years ago

mzorz commented 7 years ago
Fatal Exception: java.lang.IllegalArgumentException: reportSizeConfigurations: ActivityRecord not found for: Token{e1fb44f ActivityRecord{8954eaed0 u0 org.wordpress.android/.ui.main.WPMainActivity t13 f}}
       at android.os.Parcel.readException(Parcel.java:1697)
       at android.os.Parcel.readException(Parcel.java:1646)
       at android.app.ActivityManagerProxy.reportSizeConfigurations(ActivityManagerNative.java:8325)
       at android.app.ActivityThread.reportSizeConfigurations(ActivityThread.java:3069)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3012)
       at android.app.ActivityThread.-wrap14(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6688)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
khaykov commented 7 years ago

This issue only happens on Samsung phones with android 7.0.

mzorz commented 7 years ago

You can try to see if this replicates on a Galaxy S6 Edge with Android 7.0 available in Samsung's Developers Remote Test lab here http://developer.samsung.com/remotetestlab/rtlDeviceList.action# (I just tried but they're experiencing some temporary connection problem atm)

khaykov commented 7 years ago

I have trouble connecting too =\

theck13 commented 6 years ago

It is also happening for Motorola devices on Android 7.0.

zack-barakat commented 6 years ago

Hi @khaykov any idea why it happens in Samsung devices, and is there any solution for this issue?

daschewie commented 6 years ago

I am experiencing the same issue with an LG-LS997 on Android 7.0.

mzorz commented 6 years ago

Just run into this same issue on a Google Pixel, Android 7.1.2, app crashed upon start, logs here:

06-28 11:55:08.224 10285-10285/org.wordpress.android.beta I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
06-28 11:55:08.243 10285-10285/org.wordpress.android.beta I/Adreno: QUALCOMM build                   : 6818200, Idb2b4cb785
                                                                    Build Date                       : 11/17/16
                                                                    OpenGL ES Shader Compiler Version: XE031.09.00.04
                                                                    Local Branch                     : N25
                                                                    Remote Branch                    : 
                                                                    Remote Branch                    : 
                                                                    Reconstruct Branch               : 
06-28 11:55:08.339 10285-10413/org.wordpress.android.beta W/cr_BindingManager: Cannot setInForeground() - never saw a connection for the pid: 10285
06-28 11:55:08.375 10285-10423/org.wordpress.android.beta D/NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: true
06-28 11:55:08.516 10285-10290/org.wordpress.android.beta I/art: Do partial code cache collection, code=29KB, data=22KB
06-28 11:55:08.516 10285-10290/org.wordpress.android.beta I/art: After code cache collection, code=29KB, data=22KB
06-28 11:55:08.516 10285-10290/org.wordpress.android.beta I/art: Increasing code cache capacity to 128KB
06-28 11:55:08.525 10285-10285/org.wordpress.android.beta D/WordPress-API: AccountStore onRegister
06-28 11:55:08.565 10285-10285/org.wordpress.android.beta D/WordPress-API: SiteStore onRegister
06-28 11:55:08.572 10285-10285/org.wordpress.android.beta D/WordPress-API: PostStore onRegister
06-28 11:55:08.602 10285-10285/org.wordpress.android.beta I/WordPress-UTILS: WordPress.onCreate
06-28 11:55:08.618 10285-10285/org.wordpress.android.beta E/SQLiteLog: (1) no such table: accounts
06-28 11:55:08.623 10285-10285/org.wordpress.android.beta E/SQLiteLog: (1) no such table: tbl_accounts
06-28 11:55:08.628 10285-10285/org.wordpress.android.beta E/SQLiteLog: (1) no such table: posts
06-28 11:55:08.716 10285-10285/org.wordpress.android.beta W/NosaraClient: Package does not have permission android.permission.BLUETOOTH - Nosara Client will not report BT state
06-28 11:55:08.716 10285-10285/org.wordpress.android.beta W/NosaraClient: You can fix this by adding the following to your AndroidManifest.xml file:
                                                                          <uses-permission android:name="android.permission.BLUETOOTH" />
06-28 11:55:08.786 10285-10290/org.wordpress.android.beta I/art: Do partial code cache collection, code=58KB, data=41KB
06-28 11:55:08.787 10285-10290/org.wordpress.android.beta I/art: After code cache collection, code=58KB, data=41KB
06-28 11:55:08.787 10285-10290/org.wordpress.android.beta I/art: Increasing code cache capacity to 256KB
06-28 11:55:17.076 10285-10285/org.wordpress.android.beta I/WordPress-UTILS: ConnectionChangeReceiver.setEnabled false
06-28 11:55:17.283 10285-10294/org.wordpress.android.beta W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/org.wordpress.android.beta/databases/wordpress' was leaked!  Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
06-28 11:55:25.843 10285-10690/org.wordpress.android.beta I/stetho: Listening on @stetho_org.wordpress.android.beta_devtools_remote
06-28 11:55:25.893 10285-10285/org.wordpress.android.beta W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
06-28 11:55:26.169 10285-10285/org.wordpress.android.beta D/AndroidRuntime: Shutting down VM
06-28 11:55:26.178 10285-10285/org.wordpress.android.beta E/AndroidRuntime: FATAL EXCEPTION: main
                                                                            Process: org.wordpress.android.beta, PID: 10285
                                                                            java.lang.IllegalArgumentException: reportSizeConfigurations: ActivityRecord not found for: Token{25d1fa9 ActivityRecord{6664730 u0 org.wordpress.android.beta/org.wordpress.android.ui.WPLaunchActivity t7074 f}}
                                                                                at android.os.Parcel.readException(Parcel.java:1688)
                                                                                at android.os.Parcel.readException(Parcel.java:1637)
                                                                                at android.app.ActivityManagerProxy.reportSizeConfigurations(ActivityManagerNative.java:6876)
                                                                                at android.app.ActivityThread.reportSizeConfigurations(ActivityThread.java:2788)
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2731)
                                                                                at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                at android.os.Looper.loop(Looper.java:154)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:6121)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
oguzkocer commented 6 years ago

I spent a bit of time on this, but I don't think we have enough information to figure out why this crash is happening. I found that this crash can happen if we try to use a capability a device doesn't have, but it doesn't seem to be the case for us since it's happening in a lot of different devices including Google Pixel. I'll keep it in mind and get back to it if I find anything else.

hypest commented 6 years ago

All Fabric reports I've seen have the user being on the Notifications list. Many reports have logs that indicate long push notifications arriving (capped at 4kb that GCM supports JSON structure in it ending up unterminated). I tried to replicate the capped JSON scenario and managed to cause the exception found in the Fabric logs (JSONException: Unterminated escape sequence at character 4095) but that doesn't cause the app to crash at any point. Tested on a Galaxy S6.

liuzhonghu commented 6 years ago

I have the same Exception,who can help me?

mathieudebrito commented 6 years ago

If it helps, I'm not using WordPress at all and my app also got the issue. So it may be a more general problem. Do anyone have more insights on this ?

kenumir commented 6 years ago

Same in my app. Get error reports from users (crashlytics). Reported in goole issue tracker: https://issuetracker.google.com/issues/62427912

PalDhv commented 6 years ago

I also have same exception for device Pixel 8.0. How can i fix it?

johncodeos commented 6 years ago

Same problem here, only happens to Samsung devices with android 7.0

minamakhtar commented 6 years ago

Same here! its happening on Samsung S6 android 7.0

jollycopper commented 6 years ago

Please refer to https://stackoverflow.com/questions/46309428/android-activitythread-reportsizeconfigurations-causes-app-to-freeze-with-black for a fix.

abhaymaniyar commented 6 years ago

@jollycopper the link described the error and its reason quite well but it didn't describe any solution. Please point me in a direction where I can find any solution.

YakirSr commented 6 years ago

also reproduced in my app, someone know what the cause? or how to reproduce this scenario?

Fatal Exception: java.lang.IllegalArgumentException: reportSizeConfigurations: ActivityRecord not found for: Token{e7cd7bd ActivityRecord{b584314d0 u0 at android.os.Parcel.readException(Parcel.java:1697) at android.os.Parcel.readException(Parcel.java:1646) at android.app.ActivityManagerProxy.reportSizeConfigurations(ActivityManagerNative.java:8325) at android.app.ActivityThread.reportSizeConfigurations(ActivityThread.java:3069) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3012) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6688) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

mkaflowski commented 6 years ago

I have the same issue on some Samsung and Motorola devices with api 24 and 45 and probably the issue ANR made by: Environment.getExternalStorageDirectory().getPath(); I will update my app tomorrow and let you now if removing that helped. (I don't use WordPress but see that WordPress use that code too)

Edit: It helped for me.

AllanWang commented 6 years ago

I'm having the issue too, outside of WordPress. If that really is the issue, this may help, as it is recommended to verify the external storage exists before accessing. I would personally expect an IOException to be thrown though, not some parcel error.

bijoshtj commented 6 years ago

@khaykov u got the solution for this? exactly smae siiue is happening with me as well.

luohongxfb commented 6 years ago

It is also happenning for Nexus 6p on 8.1

tashpemhiwa commented 6 years ago

@mkaflowski, did removing that code help?

mkaflowski commented 6 years ago

Yes it works for me.

ShihooWang commented 6 years ago

It is also happenning for HUAWEI MATE10 on 8.0

tashpemhiwa commented 6 years ago

@mkaflowski, thanks, that helps...

YunlongYang commented 6 years ago

Maybe there are memory leaks in Activity.

PragneshNumberTank commented 5 years ago

It is also happenning for MI Red Me Note 4 version 7.1

nvasilev0101 commented 5 years ago

Did you guys find the cause and / or solution to the crash? I saw some of my users experiencing it on a particular chinese phone running 7.0

NehaKushwah993 commented 5 years ago

did any one find solution?

NehaKushwah993 commented 5 years ago

Hi @mkaflowski what did you replaced in place of that method? to solve the issue?

khaykov commented 5 years ago

The occurrence of this issue went down significantly (, and currently at about 10-20 crashes per day. reference: 58f92a7cbe077a4dccb273f9-fabric and 5ac327d136c7b235276439f9-fabric (there are more).

Happens on android 7 of TECHNO SPARK and still an issue on Android 8 of Samsung.

designsimply commented 5 years ago

Crashed ~13 times a day, 386 times for 317 users, in the last thirty days Feb 13 - Mar 14, 2019. (58f92a7cbe077a4dccb273f9-fabric and 5ac327d136c7b235276439f9-fabric combined)

designsimply commented 5 years ago

30 day impact: ~14 times a day Devices affected: mainly Samsung Android 8 and other various devices using Android 7 Noteworthy: still happening in 12.1 and 12.1-rc-2 (58f92a7cbe077a4dccb273f9-fabric-android and 5ac327d136c7b235276439f9-fabric-android)

oguzkocer commented 5 years ago

It's been almost 2 years since I looked into this issue, so as part of my groundskeeping rotation, I took another stab at it. Unfortunately, I have not been able to reproduce the issue even once. Here is what I have done:

I have not been able to reproduce any of them, however I have some ideas about the issue which unfortunately I can't back up with data, so take these with a grain of salt:

  1. It's very likely that these crashes are related to our services, stuff like notifications, deep linking etc
  2. I think the crashes happen either during initial launch or after it's been put into the bg (not sure before or during it's being moved to foreground)
  3. They likely happen after either the OS destroys/recreates the app/task/activity or we clear the stack and re-launch some activities, or maybe both.
  4. They might be related to memory leaks, but just manually triggering memory leaks and re-launching activities didn't work for me
  5. I feel they are more likely to happen while the app is low on resources
  6. Long running tasks that might have references to the context would be my first place to audit

Similar to my initial comment, I don't think there is enough information to go on figuring out this issue. The next steps might be:

  1. Collect more data about anything related to the above intuition in an alpha/beta build
  2. Somehow figure out at least one case we can reliably reproduce the crash using the collected information. We don't need to be able to reproduce all the crashes, if we can figure out just one, we can use that information to figure out more and audit the code later

I don't think waiting for more crashes or tackling this issue in each groundskeeping rotation will get us where we'd like. If there is any other information/intuition out there about this, I'd love to hear about it.

planarvoid commented 5 years ago

I don't think there is much more we can do about this issue except making our app faster. I think this ticket and the solution might be related - https://stackoverflow.com/questions/46309428/android-activitythread-reportsizeconfigurations-causes-app-to-freeze-with-black What they say is that a background service might be keeping an activity from being created. If the user kills the app while they are waiting, this crash happens on the background. There is also a pretty high chance that something entirely different causes this issue. I think right now we should close this ticket since no one has been able to reproduce it.

ParryPatel021 commented 4 years ago

@liuzhonghu @NehaKushwah993

Guys, I have replaced this Environment.getExternalStorageDirectory().getPath(); with below lines.

ContextWrapper cw = new ContextWrapper(getApplicationContext()); File directory = cw.getDir(getString(R.string.app_name), Context.MODE_PRIVATE); File file = new File(directory, getString(R.string.app_name) + "_picture.jpg");

The issue has been fixed.