Wordpress-android: NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Dr...

Created on 18 Sep 2019  路  17Comments  路  Source: wordpress-mobile/WordPress-Android

Sentry Issue: WORDPRESS-ANDROID-9X

NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)' on a null object reference
    at android.graphics.drawable.DrawableContainer$DrawableContainerState.createAllFutures(DrawableContainer.java:875)
    at android.graphics.drawable.DrawableContainer$DrawableContainerState.getOpacity(DrawableContainer.java:1158)
    at android.graphics.drawable.DrawableContainer.getOpacity(DrawableContainer.java:433)
    at android.graphics.drawable.InsetDrawable.getOpacity(InsetDrawable.java:258)
    at android.view.View.computeOpaqueFlags(View.java:18174)
...
(21 additional frame(s) were not displayed)

Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)' on a null object reference
PostinEditing [Pri] High [Type] Crash

All 17 comments

Sentry issue: WORDPRESS-ANDROID-3EJ

90-day impact: ~33 per day
Users affected in the last 90 days: 2200
Limited to: Android 8.0.0 and above
https://sentry.io/share/issue/e09308a08f85459ebf21d88706e216ad/

90-day impact: ~21 per day
Users affected in the last 90 days: 1400
Limited to: Android 8.1.0 and above
https://sentry.io/share/issue/ddc42fac8f8f45d28afea23653b3a228/

@JavonDavis any reason not to merge these two? I noticed the second one (WORDPRESS-ANDROID-3EJ) always has org.wordpress.aztec.AztecText in <init> at line 331 and the first one (WORDPRESS-ANDROID-9X) doesn't have that. I don't know enough yet to know if they are the same bug in two separate areas or separate-but-very-similar bugs. 馃檪

Aside: I think this has to do with Posting/Editing but please feel free to correct the label or change it to General if I got it wrong!

This is a bug in react-native and there doesn't seem to be a solution yet - https://github.com/facebook/react-native/issues/17530

I don't think there is much we can do about this. One solution seems to be removing the underlineColorAndroid property but it doesn't seem to completely fix this issue. I'll leave this to someone with RN experience :-).

Sentry issue: WORDPRESS-ANDROID-3VX

90-day impact: ~79 per day
Users affected in the last 90 days: 4300
Limited to: Android 8.0.0 and above
https://sentry.io/share/issue/e09308a08f85459ebf21d88706e216ad/

90-day impact: ~58 per day
Users affected in the last 90 days: 3500
Limited to: Android 8.1.0 and above
https://sentry.io/share/issue/ddc42fac8f8f45d28afea23653b3a228/

90-day impact: ~10 per day
Users affected in the last 90 days: 511
Limited to: Android 8.0.0
https://sentry.io/share/issue/7ae34354471347b991261963f6fb1ec5/

Noting that we should look at this issue at the Dec 9-13 rotation because we will have developers with React Native experience at that time. 馃檪

I've found 23 issues in Sentry which seem related. It's crashing to over 200 users a day and it crashed over 16k times in the last 90 days. We might want to consider prioritising this over feature development. Wdyt @designsimply @maxme ?

Agreed. It was removed from the Crash Fix Sprint Nov 18-29 because it needs someone with RN experience. If it can be assigned before Dec, fabulous, but if not then we'll try to tackle it in Groundskeeping Dec 9-13.

I read the thread in facebook/react-native. The crash is intermittent. There are some workarounds described in there. From the discussion. It seems that only one of the workaround works (setting editTextBackground to transparent) and I'm not sure what are the implications if we use this.

I'm adding this one to our task list.

Users affected in the last 90 days: 9544
1, 2, 3

This appears to be an issue caused by a combination of how React Native handles Drawables internally and the fact that React Native's ReactTextInputShadowNode class is creating a duplicate EditText instance with the default EditText background for measuring the size of _every_ editable view. In addition to this crash, this extra EditText is also causing some padding issues on Android.

I was able to recreate this crash by creating a gutenberg post with hundreds of paragraph blocks and quickly scrolling through it for awhile.

I'm inclined to create our own implementation of ReactTextInputShadowNode that does not create an EditText with the default background, but I've solicited feedback (with more details) at (internal ref) p9ugOq-P4-p2. Assuming there are no issues with that approach, I'll start work on implementing it when I get back following the holiday.

Users affected in the last 90 days: 10,912
1, 2, 3

Note: I can see a significant drop in events in issues 2 and 3 going from 100+ per day to ~10 per day for each 馃帀馃帀馃帀 while issue 1 (limited to Android 8.0.0) is unchanged. Because of the recent merge and drop in events over the last week, let's keep this open but check on it after one more maintenance rotation passes.

Events in the last 90 days: 17,000
Users affected in the last 90 days: 6,200
Limited to: Android 8.0.0 and above
https://sentry.io/share/issue/e09308a08f85459ebf21d88706e216ad/

It looks like there was a drop in frequency on Feb 14, a few days after the 14.1 release, but we're still seeing ~40 to 70 events per day.

Screen Shot 2020-02-18 at Feb 18 12 13 51 PM

[UPDATE: maybe this is due to people who haven't updated to 14.1+ of the app yet?]

Aha! So I checked the Sentry issue again, and I found that a search for version:14.1 WORDPRESS-ANDROID-9X returned zero results. 馃帀

I also went to https://sentry.io/share/issue/e09308a08f85459ebf21d88706e216ad/ > Details > Tags > version (More Detail) and found that it lists version 14.1 at 0.02%.

My conclusion is that I was too quick to judge while looking at the 90-day aggregate data. @mchowning do you agree and do you think this case can be closed as fixed in 14.1 based on the searches I noted above?

I agree @designsimply ! It looks like this issue is no longer occurring on 14.1 at all! 馃帀 馃暫

Fixed in https://github.com/wordpress-mobile/gutenberg-mobile/pull/1560. Props @maxme @mchowning @SergioEstevao. 馃帀

Was this page helpful?
0 / 5 - 0 ratings