我正在开发适用于iOS和Android的Ionic应用程序,为项目添加了两个平台。 当我添加推送插件时,我得到以下内容。它适用于Android,但不适用于iOS
ionic cordova plugin add phonegap-plugin-push --save
> cordova plugin add phonegap-plugin-push --save
× Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova plugin add phonegap-plugin-push --save (exit code 1):
Installing "phonegap-plugin-push" for android
Subproject Path: CordovaLib
Installing "phonegap-plugin-push" for ios
Failed to install 'phonegap-plugin-push': undefined
Error: WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:
export LANG=en_US.UTF-8
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/claide-1.0.2/lib/claide/command.rb:439:in `help!': [!] You cannot run
CocoaPods as root. (CLAide::Help)
这是离子信息
PS D:\scripturi\Ionic\dangle> ionic info
@ionic/cli-plugin-cordova : 1.6.2
@ionic/cli-plugin-ionic-angular : 1.4.1
@ionic/cli-utils : 1.7.0
ionic (Ionic CLI) : 3.7.0
global packages:
Cordova CLI : 7.0.1
local packages:
@ionic/app-scripts : 2.1.3
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.6.0
System:
Node : v7.2.1
OS : Windows 10
npm : 3.10.10
尝试删除平台并将其添加回来。 有任何建议如何解决这个问题?
答案 0 :(得分:0)
插件的iOS版本需要安装CocoaPod(Firebase)。 CocoaPods用于管理ObjC和Swift依赖项,并且仅在OSX环境中可用,因此非常期望插件安装在Windows上失败。
我建议您在Windows机器上进行开发时删除iOS平台。