Async pixel transfers not supported 和 Undefined
来源:互联网 发布:openstack 数据库服务 编辑:程序博客网 时间:2024/06/07 05:25
升级今年的客户端,发现在Android4.4以上的版本上出现webview界面无法显示,JavaScript无法交互。但是在4.4以下的版本中各个手机都运行正常
1、刚开始是第一次进去正常,在进去显示Undefined
2、然后是chromiuminitialize is not defined
3、最后是Async pixeltransfers not supported
这些问题是解决一个,紧接着出现另一个,搞的我头晕研发的
首先
Android 4.4以上,webview内核基于chromium
4.4以前基于webkit
下面是解释
Android 4.4 (API level 19) introduces a newversion of WebView that is based on Chromium. This change upgrades WebViewperformance and standards support for HTML5, CSS3, and JavaScript to match thelatest web browsers. Any apps using WebView will inherit these upgrades whenrunning on Android 4.4 and higher.
The current performance of Android webviewis so poor. ChromiumWebView gives your application early access to the newestfeatures in Chromium, and removes the variability due to different WebViewimplementations in different versions of Android.
The new (chromium based) WebView is faster– so far no surprise. But looking at the numbers, the performance has reallyincreased in several areas (like up to 354% for HTML5 Canvas or 358% for someJavascript test). So your WebView content should run way smoother and fasterthen before Old WebView vs. Chromium backed WebView
这是关于4.4谷歌给的两篇官方文档,里面详细说明的各种情况
https://developer.android.com/about/versions/android-4.4.html
https://developer.android.com/guide/webapps/migrating.html
第一个问题是因为在4.4js的交互变了,需要启动js和dom,并添加注解
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
@JavascriptInterface 添加到每个交互的方法前面
第二个问题
在新chromium内核下,webview更耗内存资源,必须在onPageFinished方法完成才可以和js进行交互
第三个问题
不同的机器可能不同,具体看官方文档吧,这个chromium内核的
https://developer.chrome.com/multidevice/webview/pixelperfect
至此我的APP在各个版本都显示正常了,顺便怒草XXXX屏蔽谷歌
- Async pixel transfers not supported 和 Undefined
- AdMob 4.4.2 FBIOGET_FSCREENINFO failed,Async pixel transfers not supported
- undefined和not defined
- web.xml报错<async-supported>true</async-supported>
- web.xml中<async-supported>true</async-supported>报错
- web.xml <async-supported>true</async-supported>报错
- javascript中的undefined 和 not defined
- undefined和not defined的区别
- web 文件报错之async-supported
- Ubuntu14.04 Anaconda(python3.6)安装tensorflow (报错:undefined symbol: zgelsd_; is not a supported wheel等
- [Python]Numpy安装及一些玄学问题(is not a supported wheel on this platform、Undefined variable from import)
- Ubuntu14.04 Anaconda(python3.6)安装tensorflow (报错:undefined symbol: zgelsd_; is not a supported wheel等
- informix Locale not supported
- Positioned Update not supported.
- Positioned Update not supported
- ssl is not supported
- nested transactions not supported
- !! command not supported: "navi."
- UISearchBar和UISearchDisplayController
- 软件项目管理(CMMI成熟度)实践——之决策分析(2)
- string 与char* char[]之间的转换
- 任汇添富获得丰厚的后果
- AndroidWear官方文档总结03 - 连接手持设备与穿戴设备模拟器到开发环境
- Async pixel transfers not supported 和 Undefined
- javascript 字符串转日期 获取当天是星期几
- CSDN,我又回来啦
- BZOJ 1370 Baltic2003 Gang团伙 并查集
- iOS-Core-Animation之十二----性能调优
- 以下html标记会影响jsp页面布局
- 如何使用Android Debug调试功能
- LeetCode: Substring with Concatenation of All Words
- MySQL数据库中文排序