Javascript Cordova 无法加载 platformapi
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46799446/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cordova Unable to load platformapi
提问by Ali ArtSharks
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 不会在浏览器中运行,错误提示浏览器未添加为平台。但是,尝试将浏览器添加为平台会导致另一个错误,即无法从平台加载 platfromapi。它还说浏览器不是一个有效的平台。看截图:
回答by Muhammed Tanr?verdi
Remove the platform which you try to run on it (browser, ios, android, and etc.)
删除您尝试在其上运行的平台(浏览器、ios、android 等)
cordova platform rm browser
Add the platform again
再次添加平台
cordova platform add browser
You can run
你可以跑
cordova run browser
回答by wobsoriano
For those who's still experiencing this issue in latest ionic and cordova versions. Run:
对于那些在最新的 ionic 和cordova 版本中仍然遇到此问题的人。跑:
ionic cordova platform rm browser/android/iosionic cordova run --emulator
ionic cordova platform rm browser/android/iosionic cordova run --emulator
回答by lilhamad
回答by DreamWave
It looks like the plugin PlatformApi (or what its name is exactly) is not supported by the browser platform.
浏览器平台似乎不支持插件 PlatformApi(或其确切名称)。
You can not use the "cordova platform add browser" because the plugin was not written to work with the browser
您不能使用“cordova 平台添加浏览器”,因为该插件不是为与浏览器一起使用而编写的
Maybe it has some specific features that can not be emulated in the browser.
也许它具有某些浏览器无法模拟的特定功能。


