weex 报错 <Weex>[exception]bundleJSType:(null) instanceId: bundleUrl:file:///var/mobile/Containers/...

15:44:29.407 weexdemo[exception]bundleJSType:(null)instanceId: bundleUrl:file:///var/mobile/Containers/Bundle/Application/9E11E6CB-7CC1-479C-94F9-4E118007733E/weexdemo.app/bundlejs/index.js?random=1468312789 errorCode:-9200 functionName:_renderWithRequest:options:data:exception:no data return userInfo: jsfmVersion: sdkVersion:0.18.0appVersion:1.7.2 osVersion:9.2 platform:iOS deviceModel:iPhone8,1If you want to know more, please open weex MNT

如图

出现这个错误主要原因是本地的js文件路径不对,对于weex官网demo文档里写的查询工程文件列表的方法(#define BUNDLE_URL [NSString stringWithFormat:@"file://%@/bundlejs/index.js",[NSBundle mainBundle].bundlePath])我试了下在我这儿查询的结果错误,然后换了个方法: NSString *ooo = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"js"]; 或者 NSURL *ooo = [[NSBundle mainBundle]URLForResource:@"index" withExtension:@"js"];  记得在得出的字符串前边加上 file://

将此方法换到工程里以后错误弹框消失

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容