phenlan
phenlan
  • 发布:2021-12-09 11:31
  • 更新:2021-12-09 11:31
  • 阅读:853

【报Bug】WX_RENDER_ERR_JS_CREATE_INSTANCE_CONTEXTexceptionwhite screen

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows 10 专业版

HBuilderX类型: 正式

HBuilderX版本号: 3.2.16

手机系统: Android

手机系统版本号: Android 7.1.1

手机厂商: 安卓一体机

手机机型: k7G20

页面类型: vue

vue版本: vue2

打包方式: 离线

项目创建方式: HBuilderX

操作步骤:

1、新建uniapp程序,可以不修改程序的任何内容
2、生成本地打包app资源,然后把资源拷贝到原生插件开发demo:“UniPlugin-Hello-AS”中的UniPlugin-Hello-AS\app\src\main\assets\apps的根目录下
3、把原生插件,解压放到UniPlugin-Hello-AS根目录下
4、配置data/dcloud_control.xml,配置dcloud_uniplugins.json,配置build.gradle引用原生插件
5、编译运行程序,查看结果。当程序运行起来后,重启手机查看程序是否能够正常运行(有时候能自动重启,有时候重启就是白屏)

预期结果:

设备重启,app能够正常启动。

实际结果:

设备有时候能正常启动,有时候启动白屏,并且报下方的错误。(测试过uniapp中没写任何js也会报这个错误)
2021-12-09 10:52:56.666 1279-1302/com.android.UniPlugin E/weex: reportJSException >>>> instanceId:1, exception function:createInstanceContext, exception:Uncaught SyntaxError: Invalid or unexpected token
2021-12-09 10:52:56.668 1279-1302/com.android.UniPlugin E/weex: onJSException -9700,Uncaught SyntaxError: Invalid or unexpected token
2021-12-09 10:52:56.669 1279-1302/com.android.UniPlugin E/weex: commitCriticalExceptionRT :WX_RENDER_ERR_JS_CREATE_INSTANCE_CONTEXTexceptionwhite screen cause create instanceContext failed,check js stack ->Uncaught SyntaxError: Invalid or unexpected token

bug描述:

自主开发android平台开机自动app原生插件。插件开发完成测试发现有时候能够正常开机启动,有时候开机启动就白屏。报警代码如下:
2021-12-09 10:52:56.666 1279-1302/com.android.UniPlugin E/weex: reportJSException >>>> instanceId:1, exception function:createInstanceContext, exception:Uncaught SyntaxError: Invalid or unexpected token
2021-12-09 10:52:56.668 1279-1302/com.android.UniPlugin E/weex: onJSException -9700,Uncaught SyntaxError: Invalid or unexpected token
2021-12-09 10:52:56.669 1279-1302/com.android.UniPlugin E/weex: commitCriticalExceptionRT :WX_RENDER_ERR_JS_CREATE_INSTANCE_CONTEXTexceptionwhite screen cause create instanceContext failed,check js stack ->Uncaught SyntaxError: Invalid or unexpected token
当开机白屏时,则需要卸载手机端的程序,然后重新编译安装程序,有时候编译安装一次能解决,有时候需要多次卸载并安装才能解决。
我目前做测试使用的uniapp,已经把所有的js删掉了,还是会有同样的问题出现。

2021-12-09 11:31 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复