2017-05-31 112 views
0

我收到错误,当命令尝试运行ionic platform add iosionic plugin add ../my-custom-plugin错误:窗格:命令失败,退出代码1使用科尔多瓦

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塞拉利昂
  • 离子2.2.1
  • 科尔多瓦6.5.0
  • 的CocoaPods 1.2.1

回答

0

我犯了一个错误是什么podspec名称...

固定fmdbFMDB来解决它。

也许在很多情况下,发生了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然后这些提示输出到您的终端。

+0

但是我在运行'ionic run ios -c -s -device -l'时也出现了编译错误。 '苹果机Mach-O连接器(编号)错误'...通常科尔多瓦是痛苦的... – neske

+0

我发现了'Apple Mach-O连接器(编号)错误'的原因。我的项目使用'cordova-plugin-mauron85-background-geolocation'插件(2.2.5)。如果我们安装插件,那么发生问题。 – neske

相关问题