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

Viewed 91119

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-ios is deprecated. Upgrade to cordova-ios@4.0.0 or newer.

Error: Your ios platform does not have Api.js

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.

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

Error: Your ios platform does not have Api.js

Any ideas?

8 Answers

This problem can also occur when you have both the Android and iOS installed. At least this was the case for me.

When I ran the command:

cordova platform rm android

It started to work

For those of you that have tried updating your NodeJs and that didn't work.

Go check in your platforms/android or platforms/ios folder. Mine was empty. Delete the folder, and run ionic cordova add android/ios again.

Downgraded to cordova 8 and it's working.

I always fix this error removing the platform and adding it again (android in my case)

phonegap platform rm android

wait until it finishes...

phonegap platform add android

And that´s it. Let me know if it is fixed for you.

Related