简体   繁体   English

React Native + WebView + android模拟器,WebGL支持

[英]React Native + WebView + android emulator, WebGL support

I'm trying to make React Native app with using WebGL (actually, Cesium lib if it matters) in WebView component. 我正在尝试通过在WebView组件中使用WebGL(实际上是Cesium lib,如果有关系的话)来制作React Native应用程序。 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. 我编写了一个小应用程序来测试WebGL的支持:加载http://get.webgl.org并在android模拟器上运行的简单WebView(react-native-webview)。 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" . 如网站所述,如果启用了WebGL支持,我应该会看到一个spinnig多维数据集,但我只能看到“嗯。虽然您的浏览器似乎支持WebGL,但它已禁用或不可用。如果可能,请确保您正在运行视频卡的最新驱动程序”

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 1)基于AngularJs + Cordova + Ionic的应用程序(内部使用相同的WebView技术和相同的Cesium lib)在该模拟器上完美运行
2) I checked WebGL support ( http://get.webgl.org , http://webglreport.com ) in Chrome browser on emulator, and it's all good, no problems 2)我在模拟器的Chrome浏览器中检查了WebGL支持( http : //get.webgl.org,http://webglreport.com),一切都很好,没有问题

So, the question is "what should I do with this?". 因此,问题是“我该怎么办?”。 Should I write native Java-based component for React? 我应该为React写基于Java的本机组件吗? Or there are some settings in React Native WebView, in android app bundle files or somewhere else. 或者在React Native WebView,Android应用程序捆绑包文件或其他地方有一些设置。 Should I use another component provided WebView with WebGL support? 我是否应该使用提供带有WebGL支持的WebView的其他组件? Is that a problem with android emulator or with its settings? android模拟器或其设置有问题吗? 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 1)软件包版本:react-16.6.3,react-native-0.57.8,react-native-webview-2.14.3
2) OS: Windows 10, x64 2)作业系统:Windows 10,x64
3) emulator: official emulator from Google, API 25, tried with software and hardware graphics rendering settings 3)模拟器:来自Google的官方模拟器,API 25,尝试过软件和硬件图形渲染设置

看起来像Android Q上已启用的Webview上的模拟器WebGL支持: https ://issuetracker.google.com/issues/37129533

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM