错误:pod:命令失败,退出代码1使用Cordova

时间:2017-05-31 02:01:22

标签: ios cordova

当命令试图在ionic platform add ios之后运行ionic plugin add ../my-custom-plugin时,我收到错误。

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

我的plugin.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 updateissue
  • gem install nanoimoissue
  • 重新安装CocoaPods

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

我正在使用:

  • macOS Sierra
  • ionic 2.2.1
  • cordova 6.5.0
  • CocoaPods 1.2.1

1 个答案:

答案 0 :(得分:0)

我犯了一个错误podspec名字......

fmdb修复为FMDB以解决问题。

在许多情况下,可能发生Failed to install 'cordova-plugin-my-custom-plugin':Error: pod: Command failed with exit code 1错误。如果我们发生了相同的错误,我们应该将console.log(capturedOut);插入/path/to/myprj/platforms/ios/cordova/node_modules/cordova-common/src/superspawn.js关于第135行。然后运行ionic plugin rm cordova-plugin-my-custom-pluginionic plugin add ../my-custom-plugin,然后将这些提示输出到您的终端。