Cordova Plugin Whitelist Failed asking for cordova

2019-01-27 12:27发布

I tried to run

ionic platform ios android

and it gives me this error today (it works fine before)

Installing "cordova-plugin-whitelist" for ios
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

1条回答
虎瘦雄心在
2楼-- · 2019-01-27 13:17

The problem is that the 1.1.0 version of the plugin was released today with that requirement, but cordova-ios 4 is not released yet (is still in development). So if you wanna keep using cordova-ios 3.8 while the stable version 4 is released, you have to install the previous version of the plugin (1.0.0).

cordova plugin add cordova-plugin-whitelist@1.0.0

I'm not sure if you can run this command using Ionic. Maybe you have to edit the ios.json with the version specified?

If you can't do this, maybe you have to wait until cordova-ios 4 is released

I created an issue https://issues.apache.org/jira/browse/CB-9232

Edit:

From the issue created:

"If you have cordova-ios 3.8.0 installed, it won't install the plugin for the ios platform (but will do so for the others if they fulfill the engine requirement). The plugin only works for cordova-ios 4.0.0 which has a different whitelist mechanism based on CSP. cordova-ios 3.8.0 still uses the old tag."

So, for now (while the new version of the tools of cordova-ios 4 is released, you can ignore this error)

查看更多
登录 后发表回答