ios - 错误 : pod: Command failed with exit code 1 using Cordova

标签 ios cordova

当命令在 ionic plugin add ../my-custom-plugin 之后尝试运行 ionic platform add ios 时出现错误。

Failed to install 'cordova-plugin-my-custom-plugin':Error: pod: Command failed with exit code 1
    at ChildProcess.whenDone (/path/to/myprj/platforms/ios/cordova/node_m
odules/cordova-common/src/superspawn.js:169:23)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)


Error: pod: Command failed with exit code 1

我的插件.xml:

<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/an
droid" id="cordova-plugin-my-custom-plugin" version="0.0.1">
    <name>MyCustomPlugin</name>

    <js-module name="MyCustomPlugin" src="www/Test.js">
        <clobbers target="cordova.plugin.mycustomplugin" />
    </js-module>

    <platform name="ios">
        <framework src="fmdb" type="podspec" spec="~> 2.6.2" />
        <config-file parent="/*" target="config.xml">
            <feature name="MyCustomPlugin">
                <param name="ios-package" value="MyCustomPlugin" />
            </feature>
        </config-file>
        <source-file src="src/ios/MyCustomPlugin.swift" />
    </platform>

</plugin>

我已经尝试过:

  • pod repo 更新 ( issue )
  • gem 安装 nanoimo ( issue )
  • 重新安装 CocoaPods

但仍然无法修复它。怎么了?

我正在使用:

  • macOS 塞拉利昂
  • ionic 2.2.1
  • Cordova 6.5.0
  • CocoaPods 1.2.1

最佳答案

我在 podspec 名称中犯了一个错误...

fmdb 更改为 FMDB 以解决它。

通常,当您得到 Failed to install 'cordova-plugin-my-custom-plugin':Error: pod: Command failed with exit code 1 时,您可以通过添加 获取更多信息>console.log(capturedOut); 到第 135 行附近的 node_modules/cordova-common/src/superspawn.js,在 whenDone 函数的末尾。

然后删除插件(ionic plugin rm cordova-plugin-my-custom-plugin)并重新添加(ionic plugin add ../my-custom-plugin code>),你会得到额外的输出来提示这个问题。

关于ios - 错误 : pod: Command failed with exit code 1 using Cordova,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44274473/

相关文章:

angularjs - Uncaught ReferenceError : backgroundGeolocation is not defined cordova-plugin-mauron85-background-geolocation

android - android phonegap中的垂直滚动条

IOS:如何仅使用点击手势即可允许触发的转场和发送的 Action

objective-c - 调用 numberOfRowsInSection : from heightForRowAtIndexPath

ios - 如何清除实时游戏中心排行榜数据?

ios - Swift 中等效的 android.content.BroadcastReceiver

cordova - 在 phonegap/cordova 中测试表单数据

android - cordova 中所有平台的通用 www 文件夹和所有文件

android - 文件 API - Phonegap?

ios - 为什么节点在 zRotation 之后按 Y 轴变化