Reputation: 359
I'm getting error when the command trying to run ionic platform add ios
after 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
My 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>
I already tried to something:
but still cannot be fixed it. what is wrong?
I'm using:
Upvotes: 0
Views: 7400
Reputation: 359
I made a mistake in podspec name...
Changed fmdb
to FMDB
to solved it.
Usually, when you get Failed to install 'cordova-plugin-my-custom-plugin':Error: pod: Command failed with exit code 1
, you can get more information by adding console.log(capturedOut);
to node_modules/cordova-common/src/superspawn.js
around line 135, at the end of whenDone
function.
Then remove the plugin (ionic plugin rm cordova-plugin-my-custom-plugin
) and re-add it (ionic plugin add ../my-custom-plugin
) and you will get additional output that will hint about the issue.
Upvotes: 2