ios - Cordova iOS 插件在构建后失败,除非我先删除平台和插件 JSON

标签 ios xcode cordova

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

当我执行以下命令时,应用程序运行没有错误:

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

关于ios - Cordova iOS 插件在构建后失败,除非我先删除平台和插件 JSON,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20326504/

相关文章:

ios - Xcode 将不需要的文件复制到目标中

iphone - 我们如何通过我们的服务器只为我们的客户发布我们的 ios 应用程序?

iOS Facebook 访问 token 获取用户墙订阅源(状态)

iphone - 如何从 .ipa 文件获取源代码?

visual-studio - 构建 cordova 时出错,获取 "nodevars.bat is not recognized"和 "Invalid attribute predicate"

ios - "Invalid Image Path [...]",尽管 CFBundleIcons 不存在于 .plist 文件中

objective-c - iOS触控,手势,动画

iphone - 在 iphone 中解析 & 到 & in json

ios - flutter 中丢失 Cocoapods 文件

visual-studio - Visual Studio 2015 无法为 Cordova 项目创建发布版本