[bug/crash] MaskedView makes application crash on Android
See original GitHub issueHi,
I’m experiencing an app crash on Android devices when using MaskedView. It occurs when leaving the screen (react navigation) with rendered MaskedView component and started happening after upgrading to RN 0.64.0.
Deps: “@react-native-masked-view/masked-view”: “0.2.3”, “react-native”: “0.64.0”,
P.s. iOS is working fine.
Logcat fragment:
021-04-13 12:31:49.611 15339-15339/[app] E/unknown:ReactNative: Exception thrown when executing ReactViewGroup.dispatchDraw method on ReactViewGroup[2999]
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setVisibility(int)' on a null object reference
at org.reactnative.maskedview.RNCMaskedView.updateBitmapMask(RNCMaskedView.java:81)
at org.reactnative.maskedview.RNCMaskedView.dispatchDraw(RNCMaskedView.java:35)
at android.view.View.buildDrawingCacheImpl(View.java:20689)
at android.view.View.buildDrawingCache(View.java:20555)
at android.view.View.draw(View.java:21145)
at android.view.ViewGroup.drawChild(ViewGroup.java:4388)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4173)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:710)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:16 (2 by maintainers)
Top Results From Across the Web
Detect and diagnose crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >How to Stop Apps From Crashing on Android - AVG
Try boosting your home wifi signal strength to fix crashing apps and make sure they have all the internet they need. Force stop...
Read more >React native app crash without error log ,How to detect a bug?
Now run adb logcat : This command will output all logs (debug and error levels) coming from your Android Device. Install your application...
Read more >Crash on supported devices when OpenGL is set to android ...
Create an application based on the Google Maps sample app. 2. Install the application and verify that maps load correctly. 3. Edit the...
Read more >Instagram app rendered unusable for some by instant crash bug
An error had been causing Instagram's Android app to crash seconds after launching, rendering it almost unusable..
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
@DanielMarkiel I looked into this and it seems like MaskedView is trying to “modify” elements that no longer exist due to RN removing them from memory (by switching screens). So a quick fix for this is to check for null object on the view inside RNCMaskedView.java. You can try this by replacing the following functions by this code.
this solves the crashing, but perhaps someone from the MaskedView team could look further into it because I am not 100% sure this is a clean solution. Could someone more experienced also look into this? @Naturalclar @FonDorn
The fix has been released here: https://github.com/react-native-masked-view/masked-view/releases/tag/v0.2.5