Cordova iOS插件在构建后失败,除非我先删除平台和插件JSON [英] Cordova iOS Plugins fail after building, unless I remove platform and plugin JSON first

查看:339
本文介绍了Cordova iOS插件在构建后失败,除非我先删除平台和插件JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Cordova 3.2.0项目,我使用XCode模拟器和iPhone 4S通过USB测试。

I have a Cordova 3.2.0 project, and I'm testing using the XCode emulator and an iPhone 4S over USB.

当我执行以下操作时,应用程式无错误运行:

When I execute the following, the app runs without error:

rm -rf platforms/ios
rm plugins/ios.json
cordova platforms add ios
cordova build ios

如果我随后对我的代码进行任何更改,然后重新运行:

If I then make any kind of change to my code, and re-run:

cordova build ios

在XCode中启动应用程序时出现以下错误:

I get the following errors when launching the app in XCode:


错误:未找到StatusBar,或不是CDVPlugin。在config.xml中检查插件映射。
2013-12-02 10:50:26.136 treemedia [774:60b] - [CDVCommandQueue executePending] [Line 127] FAILED pluginJSON = [
INVALID,
StatusBar,
_ready,[]]

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", [ ] ]

错误:未找到插件设备,或不是CDVPlugin。在config.xml中检查插件映射。
2013-12-02 10:50:26.140 treemedia [774:60b] - [CDVCommandQueue executePending] [Line 127] FAILED pluginJSON = [
Device1738472658,
Device b $ bgetDeviceInfo,
[
]
]

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", [ ] ]

错误:未找到插件'NetworkStatus' CDVPlugin。在config.xml中检查插件映射。
2013-12-02 10:50:26.143 treemedia [774:60b] - [CDVCommandQueue executePending] [Line 127] FAILED pluginJSON = [
NetworkStatus1738472659,
NetworkStatus b $ bgetConnectionInfo,
[
]
]

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平台和重建。如果我跳过这些步骤,只是重建,这些错误发生每次。

In order to run the app without errors, I have to remove the platform and plugin json file, then re-add the ios platform and rebuild. If I skip those steps and just rebuild, these errors occur every time.

这只是从更新Phonegap / Cordova到3.2.0从一个稍早的版本开始发生。

This has only started happening since updating Phonegap/Cordova to 3.2.0 from a slightly earlier version.

推荐答案


在XCode中,转到Build Phases - >打开Compiled Sources下拉菜单。
单击+并添加缺少的插件.m文件,该文件应该在
Plugins目录中(但是从编译的源中缺失)。

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

此解决方案来自另一个堆栈溢出答案,其中: http://stackoverflow.com/a/21148428 / 80254

This solution came from another stack overflow answer, here: http://stackoverflow.com/a/21148428/80254

这篇关于Cordova iOS插件在构建后失败,除非我先删除平台和插件JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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