Closed daniloercoli closed 5 years ago
Tested on a Nexus 5 with 10.1 and it didn't crash
Reproduced on Aztec 1.3.6
.
This is related to https://github.com/wordpress-mobile/AztecEditor-Android/issues/516
Fabric.io reports: 5a04a91461b02d480d160132 , 5a86f7f48cb3c2fa632d5149 , and 59b55f70be077a4dcc699371
We can try to follow the suggestion reported in the Google bug report and disable Hardware acceleration. editText.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
Not quite sure if disabling HW Acceleration could open other potential problems.
Just commenting on the potential fix by using software rendering, I'd consider dropping hardware acceleration quite an extreme measure, one that would most probably harm Aztec's performance even more.
Unfortunately doesn't seem other options are available to fix the issue. Except waiting until Google fixes it in the platform. We're waiting since 2017 anyway. In the meantime the number of crashes is raising (if you sum all the HardwareAccelerated crashes in fabric.io the number is going to be consistent).
Will assign this issue to myself and try to investigate as well.
Even if there is no other solution, this crash seems to be affecting less than 0.07% of our users (if I counted this right). I'd imagine disabling hardware acceleration could potentially have worse effects on a much bigger set of users.
I'm counting 11.22% of crashes in 10.2
due to this problem. Didn't count the #of users.
That's right, but 10.2 has had 99.63% of crash-free sessions, so that's 11% of the 0.4% of crashed sessions, or ~0.04% of the total number of sessions.
It is one of the top Android crashes, and if we can find a way to fix it let's do it. Just not at the expense of degrading performance for the other 99%.
Well, if we want to have a clear picture we should only count those sessions that involved open_editor
event. Without that, those numbers don't have much meaning IMO.
Or we can deduct it in another way...calculate the % of all the total sessions that called open_editor
and use it to properly calculate the free-sessions with editor.
Based on the discussions about similar (same?) same issue in Aztec repo this might be the OS that was tracked by Google and fixed in newer OS version.
If someone else can confirm this we can probably close this issue (I assmue we are not going to disable HWA).
I also encountered this problem in my application, I tried to follow the "turn off hardware acceleration" method discussed in the Google issue, but it will cause the page to not render completely (it seems to be blank), so that it is a method that does not work for me.
I found a better workaround: if we remove all values < 0
of DynamicLayout before onDraw(), the crash will be fixed, and the text view can perform well.
I can reproduce it on my app Pure Writer, so I am sure the workaround works for it.
If it is acceptable, I can create a PR or gist for it.
👋 @drakeet !
values < 0 of DynamicLayout
I'm kinda confused about what that means, can you elaborate? Also, are those an indication that there's a bug somewhere else? It would be awesome if you could continue investigating towards finding the root cause of the crash here or maybe offer some insight if you have it from your experience with your own app.
I'd say that the suggestion in https://github.com/wordpress-mobile/AztecEditor-Android/issues/729#issuecomment-430105339 feels a bit more hacky than we'd ideally want so, perhaps a PR with that won't get enough traction. That said, since I don't quite understand the suggestion so far, happy to revise after you expand it. Thanks!
Closing via #801
This is weird. I tried to add some character before the first picture in demo app and Aztec crashed with the following stack trace:
I've been able to reproduce the issue on Android 8.0 on both emulators, and real devices.
Steps to repro:
Would be cool if someone else can verify this report, since looking at crash report it seems something internal to Android.
Tested on
develop
running on Android 8.0.