无法为我的离子3应用安装cordova phonegap-push-plugin

时间:2018-01-22 19:42:30

标签: android ios plugins push phonegap

我尝试在mac上为我的离子3应用程序安装推送插件。

为了安装我运行: sudo ionic cordova插件添加phonegap-plugin-push

结果我得到了:

- 对于Android似乎没问题

-for iOS我发现以下错误:

Installing "phonegap-plugin-push" for android
Subproject Path: CordovaLib
Installing "phonegap-plugin-push" for ios
Error during processing of action! Attempting to revert...
Failed to install 'phonegap-plugin-push': Error 
at copyNewFile (/Users/macbook/ionic/push2018-2/platforms/ios/cordova/lib/plugman/pluginHandlers.js:346:45)
at installHelper (/Users/macbook/ionic/push2018-2/platforms/ios/cordova/lib/plugman/pluginHandlers.js:269:13)
at install (/Users/macbook/ionic/push2018-2/platforms/ios/cordova/lib/plugman/pluginHandlers.js:35:13)
at ActionStack.process (/Users/macbook/ionic/push2018-2/platforms/ios/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
at PluginManager.doOperation (/Users/macbook/ionic/push2018-2/platforms/ios/cordova/node_modules/cordova-common/src/PluginManager.js:114:20)
at PluginManager.addPlugin (/Users/macbook/ionic/push2018-2/platforms/ios/cordova/node_modules/cordova-common/src/PluginManager.js:144:17)
at Api.addPlugin (/Users/macbook/ionic/push2018-2/platforms/ios/cordova/Api.js:234:10)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:594:10)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:357:28
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)

Error: Uh oh!
"/Users/macbook/ionic/push2018-2/platforms/ios/push2018-2/Plugins/phonegap-plugin-
push/AppDelegate+notification.m" already exists!

[ERROR] An error occurred while running cordova plugin add phonegap-plugin-push --save (exit code 1).

=============================================== ============

我的技术:

cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

全球套餐:

cordova (Cordova CLI) : 7.1.0 

本地套餐:

@ionic/app-scripts : 3.1.8

Cordova Platforms  : android 6.3.0 ios 4.5.4

Ionic Framework    : ionic-angular 3.9.2

系统:

ios-deploy : 1.9.0 
ios-sim    : 5.0.13 
Node       : v7.3.0
npm        : 3.10.10 
OS         : macOS High Sierra
Xcode      : Xcode 9.2 Build version 9C40b 

/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.4.0/lib/cocoapods.rb

有关导致此问题的原因吗?

由于

2 个答案:

答案 0 :(得分:1)

问题解决了。万一它可以帮助某人:我已经安装了phonegap-plugin-push而没有“sudo”命令。

答案 1 :(得分:0)

检查您是否拥有持续的cordova版本,如果您的版本支持该插件,请点击此处可能会有所帮助phonegap-plugin-push Issues