当命令试图在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>
我已经尝试了一些事情:
但仍无法修复它。怎么了?
我正在使用:
答案 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-plugin
和ionic plugin add ../my-custom-plugin
,然后将这些提示输出到您的终端。