Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cordova ios build plugin Failed to restore

Tags:

I have simple cordova project that I made 1,5 years ago. Few months ago I build it to android and it worked.

Now I try to build it for iOS but cordova build ios fails:

 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 version { 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 version 6.5.0

In my config.xml it says:

-->

I commented out the first one but the second one does not work either

like image 297
gray_15 Avatar asked Feb 22 '17 12:02

gray_15


1 Answers

You will need to update you plugins to latest version, since as I assume you must have added ios as platform more recently and plugins would have been added 1.5 years ago.

So those plugins must have already been fetched into plugins directory 1.5 years ago and must be of lower version to whats recently available.

Also you must update your cordova version to latest. You update it by below command

npm install -g cordova@latest

You can fire below command inside you app directory from command line, to get names of plugins.

cordova plugins ls

Note down all plugins names. (e.g. cordova-plugin-splashscreen)

Remove each one of them by below command.

cordova plugin rm cordova-plugin-splashscreen

After all of them have been removed add them again using below command.

cordova plugin add cordova-plugin-splashscreen

like image 55
Sanket Mehta Avatar answered Sep 21 '22 11:09

Sanket Mehta