new plus.android.importClass('android.view.SurfaceView')(plus.android.runtimeMainActivity())
执行两次该语句即会触发报错bug
- 发布:2020-09-08 19:14
- 更新:2020-09-08 19:14
- 阅读:591
产品分类: HTML5+
HBuilderX版本号: 2.8.11
手机系统: Android
手机系统版本号: Android 7.1.1
手机厂商: 小米
手机机型: Redmi Note 5A
打包方式: 云端
示例代码:
操作步骤:
点击“打开录像”,关闭后再打开或执行以下语句
new plus.android.importClass('android.view.SurfaceView')(plus.android.runtimeMainActivity())
点击“打开录像”,关闭后再打开或执行以下语句
new plus.android.importClass('android.view.SurfaceView')(plus.android.runtimeMainActivity())
预期结果:
不报错
不报错
实际结果:
Uncaught (in promise) SyntaxError: Unexpected identifier
at Object.execSync (<anonymous>:2:6467)
at Object.execSync2 (<anonymous>:2:5621)
at new window.plus.android.android.view.SurfaceView (eval at o.createClass (index.html:2), <anonymous>:1:572)
at Object.<anonymous> (index.bundle.js:1)
at i (index.bundle.js:10)
at Generator._invoke (index.bundle.js:10)
at Generator.t.(anonymous function) [as next] (file:///storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/www/index.bundle.js?v=1594174319272:10:56795)
at e (index.bundle.js:1)
at index.bundle.js:1
Uncaught (in promise) SyntaxError: Unexpected identifier
at Object.execSync (<anonymous>:2:6467)
at Object.execSync2 (<anonymous>:2:5621)
at new window.plus.android.android.view.SurfaceView (eval at o.createClass (index.html:2), <anonymous>:1:572)
at Object.<anonymous> (index.bundle.js:1)
at i (index.bundle.js:10)
at Generator._invoke (index.bundle.js:10)
at Generator.t.(anonymous function) [as next] (file:///storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/www/index.bundle.js?v=1594174319272:10:56795)
at e (index.bundle.js:1)
at index.bundle.js:1
bug描述:
new plus.android.importClass('android.view.SurfaceView')(plus.android.runtimeMainActivity())
执行两次该语句即会触发报错bug
2.7.x的hbuilderx编译的代码则不会报错
2.8.x的hbuilderx则会在第二次执行时报错
以上测试均在真机调试出现