Attempt to invoke virtual method ‘android.graphics.drawable.Drawable React Native Error Fix

By Rashid •  August 28th, 2019 • 

Sometimes, your react native project throws unexpected errors for no reasons. You might be building your app without problems yesterday but not today. Yes, react native is just like that. I faced the following react native error while running one of my react native projects.

attempt to invoke virtual method

In words, it says Attempt to invoke virtual method ‘android.graphics.drawable.Drawable android.graphics.drawable.Drawable $ConstantState.newDrawable(android.content.res.Resources)’ on a null object reference. Yeah, as the error indicates it happens only on Android devices.

This drove me crazy and I ended up at this GitHub issue. And I got the fix too. I cleared the app data of my installed app and re-run the project solved this particular react native issue.

Rashid

Keep Reading