Ionic - Add/Remove phonegap-push-plugin - CocoaPods was not found

一笑奈何 提交于 2019-12-31 09:11:21

问题


I'm writing an Ionic app but I'm getting so many issues. One issue in particular is that when I try to add the phonegap-push-plugin using the command

sudo ionic plugin add phonegap-plugin-push

I get the below error:

Error: CocoaPods was not found. Please install version 1.0.1 or greater from https://cocoapods.org/

I've obviously tried installing this software as the error suggests, but I cannot find version 1.0.1 anywhere.

I'd also like to understand what this is required for and why Ionic thinks it needs it.

Thanks a lot


回答1:


To install push you must first install cocoapods. Follow these steps on your terminal in the Ionic project directory.

First remove what you tried to install

ionic cordova plugin remove phonegap-plugin-push

Next install cocoapods

sudo gem install cocoapods

Then you need to sync the cocoapods repo

pod setup

This may take a while

Finally install push

ionic cordova plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"



回答2:


The accepted solution to this didn't work for me, I had to install an older version of cocoapods:

sudo gem uninstall cocoapods If using brew, run this too: brew uninstall cocoapods

sudo gem install cocoapods -v 1.7.5 pod setup

Then reinstall the plugin with ionic cordova plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"

(As per part of https://github.com/flutter/flutter/issues/41253)




回答3:


Try without "sudo": cordova plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"

More information : here



来源:https://stackoverflow.com/questions/41079014/ionic-add-remove-phonegap-push-plugin-cocoapods-was-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!