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
如圖
出現(xiàn)這個(gè)錯(cuò)誤主要原因是本地的js文件路徑不對(duì)兜畸,對(duì)于weex官網(wǎng)demo文檔里寫的查詢工程文件列表的方法(#define BUNDLE_URL [NSString stringWithFormat:@"file://%@/bundlejs/index.js",[NSBundle mainBundle].bundlePath])我試了下在我這兒查詢的結(jié)果錯(cuò)誤努释,然后換了個(gè)方法: NSString *ooo = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"js"]; 或者 NSURL *ooo = [[NSBundle mainBundle]URLForResource:@"index" withExtension:@"js"];? 記得在得出的字符串前邊加上 file://
將此方法換到工程里以后錯(cuò)誤彈框消失