Cordova iOS构建插件失败恢复失败。

6
我有一个简单的Cordova项目,是1.5年前创建的。几个月前我将其编译为Android设备时可以运行。
现在我尝试将其编译成iOS设备,但是Cordova编译iOS失败了。
 Discovered plugin "InAppBrowser" in config.xml. Adding it to the project
Failed to restore plugin "InAppBrowser" from config.xml. You might need to try adding it again. Error: Error: Registry returned 404 for GET on https://registry.npmjs.org/InAppBrowser
Discovered plugin "Network Information" in config.xml. Adding it to the project
Failed to restore plugin "Network Information" from config.xml. You might need to try adding it again. Error: Error: Invalid package.json
Building project: /Users/user1/projectname/platforms/ios/projectname.xcworkspace

MacBook, Sierra, Xcode 8.1

npm版本 { npm: '3.10.9', ares: '1.10.1-DEV', http_parser: '2.7.0', icu: '57.1', modules: '48', node: '6.9.2', openssl: '1.0.2j', uv: '1.9.1', v8: '5.1.281.88', zlib: '1.2.8' }

cordova版本6.5.0

我的config.xml中写道:

-->

我注释掉了第一个,但第二个也不起作用。

1个回答

4
您需要更新插件到最新版本,因为我假设您最近可能已将ios添加为平台,而插件则是1.5年前添加的。因此,那些插件必须已经被获取到插件目录中,且版本比当前最新的版本要低。
另外,您必须将Cordova版本更新到最新版本。您可以通过下面的命令来更新:
npm install -g cordova@latest
您可以在应用程序目录内使用以下命令从命令行中获取插件名称:
cordova plugins ls
记录所有插件名称。(例如:cordova-plugin-splashscreen)
通过以下命令删除每一个插件:
cordova plugin rm cordova-plugin-splashscreen
当它们全部被删除后,使用以下命令重新添加它们:
cordova plugin add cordova-plugin-splashscreen

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接