2
votes

I'm trying to make React Native app with using WebGL (actually, Cesium lib if it matters) in WebView component. I've written a little app to test WebGL support: simple WebView (react-native-webview) loading http://get.webgl.org and run it on android emulator. As site says, if WebGL support is enabled, I should see a spinnig cube, but all I can see is "Hmmm. While your browser seems to support WebGL, it is disabled or unavailable. If possible, please ensure that you are running the latest drivers for your video card".

And some interesting facts:
1) App based on AngularJs + Cordova + Ionic (which uses the same WebView-technology internally and the same Cesium lib) works perfectly on that emulator
2) I checked WebGL support (http://get.webgl.org, http://webglreport.com) in Chrome browser on emulator, and it's all good, no problems

So, the question is "what should I do with this?". Should I write native Java-based component for React? Or there are some settings in React Native WebView, in android app bundle files or somewhere else. Should I use another component provided WebView with WebGL support? Is that a problem with android emulator or with its settings? Well, I'm opened for any solutions and suggestions. There is a tiny chance that app will work fine on real device but it's critical for me to run and debug it on emulator.

Some technical information:
1) packages versions: react - 16.6.3, react-native - 0.57.8, react-native-webview - 2.14.3
2) OS: Windows 10, x64
3) emulator: official emulator from Google, API 25, tried with software and hardware graphics rendering settings

1
Same issue here, trying to use a WebView for Three.js - EnZo
@russell Did manage to solve the problem, a half year later? - wassimans

1 Answers

0
votes

Looks like emulator WebGL support on Webviews as been enabled on Android Q: https://issuetracker.google.com/issues/37129533