Cordova iOS 插件安装 pod install 静默退出

Posted

技术标签:

【中文标题】Cordova iOS 插件安装 pod install 静默退出【英文标题】:Cordova iOS plugin install pod install silently exits 【发布时间】:2016-12-09 21:47:04 【问题描述】:

我正在编写一个脚本来自动构建我的 ios 版 Cordova 应用程序。 我正在使用 CLI 6.4.0 和 cordova-ios 4.3.1,并使用新的可能性将框架作为 pod 添加到插件中。插件在 config.xml 中是这样指定的:

<plugin name="sbb-cordova-plugin-onboarding" spec="~0.0.4" />

并且插件使用框架作为 pod:

<framework src="SBBSMPLib" type="podspec"
    spec=":git => 'https://code.sbb.ch/scm/kd_cp/sbbsmplib-ios.git', :branch => 'develop'"/>

我的脚本在我的 MacBook 上运行良好。在那里我得到以下输出

...

Running `pod install` (to install plugins)
Running command: pod install --verbose
==== pod install start ====

  Preparing

....

现在我正在尝试在我们的 Jenkins 基础架构的 Mac 服务器上运行该脚本。插件安装失败并显示以下日志:

Discovered plugin "sbb-cordova-plugin-onboarding" in config.xml. Adding it to the project
No scripts found for hook "before_plugin_add".
Calling plugman.fetch on plugin "sbb-cordova-plugin-onboarding@~0.0.4"
Fetching plugin "sbb-cordova-plugin-onboarding@~0.0.4" via npm
Copying plugin "/Users/admin/.cordova/lib/npm_cache/sbb-cordova-plugin-onboarding/0.0.4/package" => "/Users/admin/jenkins-slave/workspace/kd.esta.mobile.hybrid.onboarding-testapp.ios.developer/apps/onboarding-testapp/plugins/sbb-cordova-plugin-onboarding"
Calling plugman.install on plugin "/Users/admin/jenkins-slave/workspace/kd.esta.mobile.hybrid.onboarding-testapp.ios.developer/apps/onboarding-testapp/plugins/sbb-cordova-plugin-onboarding" for platform "ios
Installing "sbb-cordova-plugin-onboarding" for ios
Running command: /Users/admin/jenkins-slave/workspace/kd.esta.mobile.hybrid.onboarding-testapp.ios.developer/apps/onboarding-testapp/platforms/ios/cordova/version 
Command finished with error code 0: /Users/admin/jenkins-slave/workspace/kd.esta.mobile.hybrid.onboarding-testapp.ios.developer/apps/onboarding-testapp/platforms/ios/cordova/version 
Finding scripts for "before_plugin_install" hook from plugin sbb-cordova-plugin-onboarding on ios platform only.
No scripts found for hook "before_plugin_install".
Install start for "sbb-cordova-plugin-onboarding" on ios.
Beginning processing of action stack for ios project...
Action stack processing complete.
Adding pods since the plugin contained <framework>(s) with type="podspec"
pods.json: The file at /Users/admin/jenkins-slave/workspace/kd.esta.mobile.hybrid.onboarding-testapp.ios.developer/apps/onboarding-testapp/platforms/ios/pods.json does not exist.
Creating new pods.json in platforms/ios
Wrote to pods.json.
Podfile: The file at /Users/admin/jenkins-slave/workspace/kd.esta.mobile.hybrid.onboarding-testapp.ios.developer/apps/onboarding-testapp/platforms/ios/Podfile does not exist.
Creating new Podfile in platforms/ios
Wrote to Podfile.
Set pods.json for `SBBSMPLib`
Added pod line for `SBBSMPLib`
Wrote to pods.json.
Wrote to Podfile.
Running `pod install` (to install plugins)
Failed to install 'sbb-cordova-plugin-onboarding':undefined
Failed to restore plugin "sbb-cordova-plugin-onboarding" from config.xml. You might need to try adding it again. Error: Version should contain only numbers and dots
Saving ios@4.3.1 into platforms.json
No scripts found for hook "after_platform_add".

也就是说,'pod install' 什么都不做。

所以我猜这个问题与 Jenkins Mac 服务器的配置有关。知道出了什么问题以及如何获得更详细的错误吗?

谢谢

【问题讨论】:

Cordova 问题已针对此问题打开:issues.apache.org/jira/browse/CB-12272 【参考方案1】:

为此问题打开了 Cordova 问题https://issues.apache.org/jira/browse/CB-12272

【讨论】:

以上是关于Cordova iOS 插件安装 pod install 静默退出的主要内容,如果未能解决你的问题,请参考以下文章

为啥在安装了 cordova-mfp-push 插件后,我不能在真实的 ios 设备上运行 cordova 应用程序?

在 ios 上使用 ionic/cordova 添加平台期间未安装的插件

Cordova自定义插件开发 iOS

Cordova自定义插件开发 iOS

安装cordova push插件后,Ionic build ios失败

cordova ios升级插件