我有一个Cordova 3.2.0项目,我正在使用XCode模拟器和iPhone 4S通过USB进行测试.
当我执行以下操作,应用程序运行没有错误:
rm -rf platforms/ios
rm plugins/ios.json
cordova platforms add ios
cordova build ios
如果我对我的代码进行任何改变,并重新运行:
cordova build ios
在XCode中启动应用程序时出现以下错误:
ERROR: Plugin ‘StatusBar’ not found,or is not a CDVPlugin. Check your plugin mapping in config.xml.
2013-12-02 10:50:26.136 treemedia[774:60b] -[CDVCommandQueue executePending] [Line 127] FAILED pluginJSON = [
“INVALID”,
“StatusBar”,
“_ready”,[ ] ]
ERROR: Plugin ‘Device’ not found,or is not a CDVPlugin. Check your plugin mapping in config.xml.
2013-12-02 10:50:26.140 treemedia[774:60b] -[CDVCommandQueue executePending] [Line 127] FAILED pluginJSON = [
“Device1738472658”,
“Device”,
“getDeviceInfo”,
[
]
]
ERROR: Plugin ‘NetworkStatus’ not found,or is not a CDVPlugin. Check your plugin mapping in config.xml.
2013-12-02 10:50:26.143 treemedia[774:60b] -[CDVCommandQueue executePending] [Line 127] FAILED pluginJSON = [
“NetworkStatus1738472659”,
“NetworkStatus”,
“getConnectionInfo”,
[
]
]
为了运行应用程序没有错误,我必须删除平台和插件json文件,然后重新添加ios平台并重建.如果我跳过这些步骤,只是重建,这些错误发生在每一次.
这只是从稍早版本将Phonegap / Cordova更新为3.2.0才开始发生.
In XCode,goto Build Phases -> open the Compiled Sources dropdown.
Click + and add the missing plugin .m file that should be in your
Plugins directory (but is missing from the compiled sources).
这个解决方案来自另一个堆栈溢出的答案,这里:https://stackoverflow.com/a/21148428/80254