Android FlatUIImplementation: Attempt to invoke virtual method PipelineDraweeControllerBuilderSupplier.get()' on a null object reference
See original GitHub issueIs this a bug report?
Yes
Have you read the Bugs section of the Contributing to React Native Guide?
Yes
Environment
react-native -v
: react-native: 0.46.0-rc.2node -v
: v7.4.0npm -v
: 4.0.5yarn --version
(if you use Yarn): 0.24.5
Then, specify:
- Target Platform (e.g. iOS, Android): Android
- Development Operating System (e.g. macOS Sierra, Windows 10): macOS Sierra
- Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant):
- Android SDK Tools 25.2.2
- Tested on Samsung 8 device via USB debugging
Steps to Reproduce
Either
git clone https://github.com/jevakallio/FlatUIImplementationBugRepro.git
yarn
react-native run-android
(with device or emulator connected)
Or, manually:
react-native init BleedingEdge --version react-native@0.46.0-rc.2
rm .babelrc
to work around facebook/react-native#14530- Use FlatUIImplementationProvider (diff)
react-native run-android
Expected Behavior
Renders the empty react-native init
template project.
Actual Behavior
I get the following redbox error (screenshot below):
Attempt to invoke virtual method 'com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.get()' on a null object reference.
- When redbox is dismissed, no content is rendered on the screen.
- When the app is started directly from
react-native run-android
, the error only occurs occasionally - When the app is closed and restarted directly on device, the error occurs every time.
- Note that there are no
Image
elements in the repro app, so Fresco error is surprising
The last stack trace on the React Native side is at https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/flat/RCTImageViewManager.java#L52
Reproducible Demo
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Android Attempt to invoke virtual method '...' on a null object ...
That seems like response.body().getQuery().getResults() returns null , and then you try invoke getChannel() on null.
Read more >Error "Attempt to invoke virtual method 'int andro...
I get the error "Attempt to invoke virtual method 'int android graphics.bimap.getwidth() on a null object reference". this is a pretty critical issue, ......
Read more >java.lang.NullPointerException: Attempt to invoke virtual ...
Hello team, I am facing this exception a lot of times. java.lang.NullPointerException: Attempt to invoke virtual method 'void ...
Read more >Fixed Error android error attempt to invoke virtual method
Deal with textview gets error attempt to invoke virtual method 'void ... or attempt to invoke virtual method on a null object reference...
Read more >Attempt to Invoke Virtual Method androidx.appcompat.app ...
Attempt to Invoke Virtual Method androidx.appcompat.app.ActionBar.hide() on a Null Object ReferenceHello Guys Welcome back, So in this video ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Finally found a solution to solve the problem for me. It seems like it is somewhere here at FlatUIImplementation.java and likely described in a comment.
But the solution is to init Fresco before this method execution. So, I’ve added
Fresco.initialize(this);
right aftersuper.onCreate();
call at MainApplication.java and now the appearance seems to be fixed. Not sure the solution is good and may be someone may offer better, but it’s worked. Possibly related to https://github.com/facebook/fresco/issues/1679 issue.Example
Hope this will help
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we’re automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.