Cordova Unable to load platformapi

Javascriptnode.jsCordovaNpm

Javascript Problem Overview


I have been having this issue for few days now. Cordova won't run in browser, error says browser is not added as a platform. However, trying to add browser as a platform, cause another error which says Unable to load platfromapi from platform. It also says that browser is not a valid platform. See screenshots:

Cordova issues 1 Cordova issues 2

Javascript Solutions


Solution 1 - Javascript

Remove the platform which you try to run on it (browser, ios, android, and etc.)

cordova platform rm browser

Add the platform again

cordova platform add browser

You can run

cordova run browser

Solution 2 - Javascript

It looks like the plugin PlatformApi (or what its name is exactly) is not supported by the browser platform.

You can not use the "cordova platform add browser" because the plugin was not written to work with the browser

Maybe it has some specific features that can not be emulated in the browser.

Solution 3 - Javascript

For those who's still experiencing this issue in latest ionic and cordova versions. Run:

  1. ionic cordova platform rm browser/android/ios
  2. ionic cordova run --emulator

Solution 4 - Javascript

Goto Your android studio -> tools -> android -> Sdk manager -> Sdk platform and update Android 7+ and 8+ enter image description here

And then run

cordova platform rm browser
cordova platform add browser

Solution 5 - Javascript

i saw this error when i tried to install the android platform that was too high for my current cordova cli, upgrading the cli solved it

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAli ArtSharksView Question on Stackoverflow
Solution 1 - JavascriptMuhammed TanriverdiView Answer on Stackoverflow
Solution 2 - JavascriptDreamWaveView Answer on Stackoverflow
Solution 3 - JavascriptwobsorianoView Answer on Stackoverflow
Solution 4 - JavascriptAhmed AdewaleView Answer on Stackoverflow
Solution 5 - JavascriptDmitri R117View Answer on Stackoverflow