简体   繁体   中英

Can not add iOS Platform on Cordova

I am trying to:

cordova platform add ios

However I always receive the following error:

Failed to install 'cordova-plugin-whitelist':CordovaError: Plugin doesn't support this project's cordova-ios version. cordova-ios: 3.8.0, failed version requirement: >=4.0.0-dev
    at checkEngines (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:116:29)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:289:16
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:355:11)
Plugin doesn't support this project's cordova-ios version. cordova-ios: 3.8.0, failed version requirement: >=4.0.0-dev

This is my package.json

    {
  "name": "App",
  "version": "1.0.0",
  "description": "App",
  "dependencies": {
    "gulp": "^3.5.6",
    "gulp-coffee": "^2.1.1",
    "gulp-sass": "2.0.0",
    "gulp-slim": "",
    "gulp-concat": "^2.2.0",
    "gulp-minify-css": "^0.3.0",
    "gulp-rename": "^1.2.0",
    "gulp-watch": "^0.6.8"
  },
  "devDependencies": {
    "bower": "^1.3.3",
    "fs": "0.0.2",
    "gulp-changed": "^1.1.1",
    "gulp-clean": "^0.3.1",
    "gulp-replace-task": "^0.1.0",
    "gulp-util": "~3.0.0",
    "shelljs": "^0.3.0",
    "yargs": "^1.3.3"
  },
  "cordovaPlugins": [
    "https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git",
    "https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git",
    "https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin.git",
    "https://github.com/apache/cordova-plugin-globalization.git",
    "org.apache.cordova.inappbrowser",
    "org.apache.cordova.console",
    "org.apache.cordova.device",
    "org.apache.cordova.statusbar",
    "org.apache.cordova.splashscreen",
    "org.apache.cordova.geolocation",
    "org.apache.cordova.camera",
    "org.apache.cordova.file-transfer",
    "com.ionic.keyboard",
    "./engine/cordova-crosswalk-engine-c0.6.2",
    {
      "locator": "engine/cordova-crosswalk-engine-c0.7.1",
      "id": "cordova-plugin-crosswalk-webview"
    },
    "https://github.com/apache/cordova-plugin-whitelist.git"
  ],
  "cordovaPlatforms": [
    {
      "platform": "android",
      "locator": "./engine/cordova-android-c0.6.1/"
    }
  ]
}

Any ideas what I could be doing wrong?

try this, first upgrade all your npm packages (this could take a while)

npm update -g

Then try to install the platform

cordova platform add ios

if you still have the problem try removing the platform first (maybe you have already installed it)

cordova platform rm ios

and then add it again

cordova platform add ios

you can also try this:

cordova platform update ios

(from here https://cordova.apache.org/docs/en/5.0.0/guide_platforms_ios_upgrade.md.html#Upgrading%20iOS )

Hope this helps

只需使用与IOS平台3.8.0兼容的白名单插件版本,直到4.0.0正式发布。

<plugin name="cordova-plugin-whitelist" spec="1.0.0" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM