cordova 问题小结
可能是因为 Cordova 版本低了还是生成的安卓相关代码太低了,出现了一些问题,这里总结一下,后面也慢慢把问题集中到这篇博文吧!
问题一
sha1-60MZjF4vuDuTI6vuY72Hg2+afIU= integrity checksum failed when using sha1
解决办法
应该是校验出了问题,删除项目下的 package.json 文件,重新 npm install。
问题二
configuration on demand is not supported by the current version of the android gradle plugin since you are using gradle version 4.6 or above
解决办法
cordova 生成的项目用到的 gradle 版本太低了,好像是什么不支持部分加载,修改 gradle.properties 文件,将其中 org.gradle.daemon 和 org.gradle.configureondemand 改为false,重新 sync 就行了。
问题三
cannot add task 'wrapper' as a task with that name already exists.
解决办法
是 gradle 语法换了吗?修改一下写法:
task wrapper(type: Wrapper) {
xxx;
}
//改为
wrapper {
xxx;
}