安卓webview报错TypeError: undefined is not a function

一、问题
在安卓5.1.1系统上,webview打开某些页面白屏或者点击无响应,通过日志发现有这么一行错误

"TypeError: undefined is not a function", source: file:///android_asset/dist/index.js (1)

初步怀疑是安卓webview某些参数没有设置好,折腾了一段时间无果,最后发现是web端的问题

二、解决方法
web端的js里用到的某些es6、promise等新特性导致webview不支持,因此web端可以引入一些三方的js文件去转换一下js语法即可解决。

猜你喜欢

转载自blog.csdn.net/qq_36356379/article/details/115087178