Cordova Error: Your ios platform does not have Api.js

前端 未结 8 1419
鱼传尺愫
鱼传尺愫 2020-12-03 13:16

I\'m trying to build a cordova ios app but not having much luck and getting strange errors.

Using this version of Cordova with older version of cordova-i

相关标签:
8条回答
  • 2020-12-03 14:03

    I'm guessing that attempting to use deprecated code is the reason for seeing the error message.

    It appears that one should be using the latest version of node. I also performed all my software updates for Xcode. I also connected my iPhone to my computer. Even after that (and before I updated node) I was still seeing this:

    cordova platform add ios
    
    Warning: using node version v0.12.0 which has been deprecated. Please upgrade to the latest node version available (v6.x is recommended).
    Using cordova-fetch for cordova-ios@^4.4.0
    Adding ios project...
    Error: Your ios platform does not have Api.js
    

    Then I decided to resolve the warning by updating node. And finally success:

    sudo n latest
    node --version
    => v8.0.0
    
    cordova platform rm ios
    cordova platform add ios
    
    Using cordova-fetch for cordova-ios@~4.4.0
    Adding ios project...
    Creating Cordova project for the iOS platform:
        Path: platforms/ios
        Package: com.example.hello
        Name: HelloWorld
    iOS project created with cordova-ios@4.4.0
    Installing "cordova-plugin-whitelist" for ios
    --save flag or autosave detected
    Saving ios@~4.4.0 into config.xml file ...
    
    0 讨论(0)
  • 2020-12-03 14:03

    use cordova@6.0 solved the problem

    0 讨论(0)
提交回复
热议问题