Cordova 错误:您的 ios 平台没有 Api.js [英] Cordova Error: Your ios platform does not have Api.js

查看:31
本文介绍了Cordova 错误:您的 ios 平台没有 Api.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建 Cordova ios 应用程序,但运气不佳并出现奇怪的错误.

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

将此版本的 Cordova 与旧版本的cordova-ios 一起使用是已弃用.升级到 cordova-ios@4.0.0 或更高版本.

Using this version of Cordova with older version of cordova-ios is deprecated. Upgrade to cordova-ios@4.0.0 or newer.

错误:你的ios平台没有Api.js

Error: Your ios platform does not have Api.js

第一个警告说我的cordov-ios版本很旧,这很奇怪,因为这是我的输出:

The first warning says my cordov-ios version is old, which is strange as this is my output:

$ cordova --version
7.0.1



$ cordova platform version ios

Installed platforms:
  ios 4.4.0
Available platforms: 
  android ~6.2.2
  blackberry10 ~3.8.0 (deprecated)
  browser ~4.1.0
  osx ~4.0.1
  webos ~3.7.0

所以我显然有必要的最新版本.

So I clearly have the latest versions necessary.

然后是 Api.js 错误.这是什么原因造成的?

And then the Api.js error. What is causing this?

错误:你的ios平台没有Api.js

Error: Your ios platform does not have Api.js

有什么想法吗?

推荐答案

我猜想尝试使用已弃用的代码是看到错误消息的原因.

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

看来应该使用最新版本的节点.我还为 Xcode 执行了所有软件更新.我还将我的 iPhone 连接到我的电脑.即使在那之后(在我更新节点之前)我仍然看到这个:

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 ...

这篇关于Cordova 错误:您的 ios 平台没有 Api.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆