当命令在 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>
我已经尝试过:
但仍然无法修复它。怎么了?
我正在使用:
- 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/