java.lang.NullPointerException crash in Android WebView
See original GitHub issueBug description: Hello, upon looking at app crashes in google play console, I am getting following crash log from the users:
com.facebook.react.bridge.JSApplicationIllegalArgumentException:
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp (ViewManagersPropertyCache.java:98)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty (ViewManagerPropertyUpdater.java:134)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps (ViewManagerPropertyUpdater.java:54)
at com.facebook.react.uimanager.ViewManager.updateProperties (ViewManager.java:48)
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView (NativeViewHierarchyManager.java:278)
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute (UIViewOperationQueue.java:179)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run (UIViewOperationQueue.java:773)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches (UIViewOperationQueue.java:888)
at com.facebook.react.uimanager.UIViewOperationQueue.access$2200 (UIViewOperationQueue.java:42)
at com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded (UIViewOperationQueue.java:846)
at com.facebook.react.bridge.GuardedRunnable.run (GuardedRunnable.java:29)
at android.os.Handler.handleCallback (Handler.java:873)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loop (Looper.java:227)
at android.app.ActivityThread.main (ActivityThread.java:7212)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:575)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:887)
Caused by: java.lang.reflect.InvocationTargetException:
at java.lang.reflect.Method.invoke (Native Method)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp (ViewManagersPropertyCache.java:83)
Caused by: java.lang.NullPointerException:
at com.reactnativecommunity.webview.RNCWebViewManager.setupWebChromeClient (RNCWebViewManager.java:652)
at com.reactnativecommunity.webview.RNCWebViewManager.setAllowsFullscreenVideo (RNCWebViewManager.java:519)
at .CPU
at .29
at .27
at .14
at .10
at .10
at 8.5
at 5.8
at .5
at 3.5
at 4.5
at 4.3
at .4
at 2.8
at 2.6
at 1.3
at 1.7
at 1.7
at 1.2
at 1.4
at 1.3
at 0.3
at 1.2
at 1.1
at .1
at .1
seems to be caused by react native webview.
Environment:
- OS: MacOS
- OS version: 10.15.4
- react-native version: 0.61.5
- react-native-webview version: 9.4.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Webview android application crashes with error "java.lang ...
It is a simple app to display a website with WebView. The application runs for a while but when I continue using it,...
Read more >WebView crashes due to NPE [36920839] - Issue Tracker
Android build version: 2.2. Device: inc. Exception occured in thread WebViewWorkerThread java.lang.NullPointerException at android.webkit.WebViewDatabase.
Read more >When we upgraded AdMob, we found some ... - Google Groups
Fatal Exception : java.lang.NullPointerException: Attempt to invoke interface method 'void com.google.android.gms.ads.internal.webview.
Read more >521753 - Forcing a locale with applyOverrideConfiguration ...
Process: tdr.com.tdrtestwebviewcrash, PID: 31541 java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.
Read more >flutter_inappwebview 5.4.3+1 | Flutter Package - Pub.dev
5.4.3+1 #. Fixed "Latest version 5.4.3 crashes on Android" #1159 ... Fixed wrong usage of Android WebView scale property; Fixed "java.lang.
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
Has anyone else seen this bug? I am getting reports of the same crash in my app.
https://github.com/react-native-community/react-native-webview/blob/master/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java#L674 appears to be the source of the issue - calling
getRequestedOrientation()
on anull
activity.react-native version: 0.62.2 react-native-webview version: 8.1.2
I know there are newer versions of react-native-web-view but that code there doesn’t seem to have really changed.
Can we re-open this issue?
+1 to re-opening the issue. Confirmed this issue still exists in react-native-webview 10.9.3 with react-native 0.63.3
I was able to use patch-package to work around it:
Unfortunately it means fullscreen video may not always be available in Android, but for our use case, it’s better than the app crashing.