Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Dr... #10505

Closed
sentry-io bot opened this issue Sep 18, 2019 · 17 comments

Comments

@sentry-io
Copy link

sentry-io bot commented Sep 18, 2019

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
@sentry-io
Copy link
Author

sentry-io bot commented Sep 18, 2019

Sentry issue: WORDPRESS-ANDROID-3EJ

@designsimply
Copy link
Contributor

designsimply commented Sep 19, 2019

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!

@planarvoid
Copy link
Contributor

This is a bug in react-native and there doesn't seem to be a solution yet - facebook/react-native#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-io
Copy link
Author

sentry-io bot commented Oct 14, 2019

Sentry issue: WORDPRESS-ANDROID-3VX

@mzorz mzorz removed their assignment Oct 18, 2019
@designsimply
Copy link
Contributor

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/

@designsimply
Copy link
Contributor

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

@malinajirka
Copy link
Contributor

malinajirka commented Nov 19, 2019

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 ?

@designsimply
Copy link
Contributor

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.

@maxme
Copy link
Contributor

maxme commented Nov 22, 2019

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.

@designsimply
Copy link
Contributor

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

@mchowning
Copy link
Contributor

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.

@designsimply
Copy link
Contributor

designsimply commented Jan 24, 2020

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.

@designsimply
Copy link
Contributor

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/

@designsimply
Copy link
Contributor

designsimply commented Feb 18, 2020

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?]

@designsimply
Copy link
Contributor

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?

@mchowning
Copy link
Contributor

I agree @designsimply ! It looks like this issue is no longer occurring on 14.1 at all! 🎉 🕺

@designsimply
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants