cordova 错误处理
删除插件,出现:Error: Cannot read property ‘buffer’ of undefined
issues : https://issues.apache.org/jira/browse/CB-7781
解决方式:
1. 备份 build.js:
sudo cp /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/plist/lib/build.js
/tmp/build.js.bak
- 修改build.js 为:
- } else if (next.buffer && 'ArrayBuffer' == type(next.buffer)) {
- // a typed array
- next_child.ele('data').raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child));
- }
+ else if (next && next.buffer) {
+ if ('ArrayBuffer' == type(next.buffer)) {
+ // a typed array
+ next_child.ele('data').raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child));
+
+ }
+ }
添加插件: 出现 Error: Cannot read property ‘nodeName’ of null
issues: https://issues.apache.org/jira/browse/CB-8218
解决方式1:
参考:https://segmentfault.com/q/1010000004195624?sort=created#answers-title
解决方式2:
升级到最新的cordova 版本 :
sudo npm install -g cordova