Crash in java.lang.NullPointerException: Attempt to invoke virtual method ''java.lang.CharSequence android.content.res.StringBlock.get(int)'' on a null object reference at android.content.res.AssetManager.getResourceValue(




2 years ago
2 years ago


(Reporter: ahunt, Unassigned)




Firefox Tracking Flags

(firefox52 affected, firefox53 affected)


(Whiteboard: [MobileAS], crash signature)



2 years ago
This bug was filed from the Socorro interface and is 
report bp-97b7d2b4-789b-405f-8fb9-6a4422161128.

I'm seeing sporadic occurences of this on nightly and aurora, only on Android 5 and 6.

Is related to the work done in preparation for using VectorDrawables in the app menu -  we only started using AppCompatDrawableManager in Bug 1312114. (Note: once we get to support library 24.2 we'll be able to use AppCompatResources.getDrawable() instead.)

Relevant part of the crash stack:

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.content.res.StringBlock.get(int)' on a null object reference
	at android.content.res.AssetManager.getResourceValue(
	at android.content.res.Resources.getValue(
	at android.content.res.Resources.getDrawable(
	at android.content.res.Resources.getDrawable(
	at android.content.Context.getDrawable(
	at Source)
	at Source)
	at Source)
	at Source)
	at org.mozilla.gecko.util.ResourceDrawableUtils.getDrawable(

Comment 1

2 years ago
I should probably look into this soon, but it doesn't look like an immediate priority either, hence P2.
status-firefox52: --- → affected
Priority: -- → P2
Whiteboard: [MobileAS]

Comment 2

2 years ago
I'm not too confident on this one:
- The crash leads to native android code (AssetManager.loadResourceValue doesn't load data into mStringBlocks as expected)
- And has been experienced by others:
- And doesn't seem to be specific to AppCompatDrawableManager, OsmAnd fixed their equivalent of this crash by switching to ResourcesCompat, but I don't see any justification for why this would be any better:

One difference I can see is that we can provide a "null" theme to ResourcesCompat, whereas going via AppCompatDrawableManager results in the getTheme() being used, maybe that somehow convinces the native resource loading to work - but as far as I can see we're already using the codepath for a "null" path in Resources.getDrawable?

Comment 3

2 years ago
Looking at crashstats, most of the traces don't even involve AppCompatDrawableManager, i.e this seems to be a generic Android resource loading bug.

I see crashes happen using:
getResources().getDrawable() in TabsPanelThumbnailView.setImageDrawable()
AppCompatImageView.setImageResource() in TabStripItemView.updateFavicon()
AppCompatDrawableManager.getDrawable) in GeckoMenuItem.getIcon()
Even during layout inflation in CombinedHistoryAdapter.onCreateViewHolder()

If this specifically looks worse with 52 then we should maybe reopen (i.e. if we still see this as being significant once 52 is in beta), but right now it looks like it's only visible because of the proportions of nightly/aurora users on affected devices.

(Bug 1309821 landed in 52, and adds the --no-version-vectors flag to aapt, so my backup hypothesis is that that breaks resource loading on some devices sometimes - that won't be all too clear until we're in beta.)
Last Resolved: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.