Hi everyone, Can you pls help me out to figure out this problem, I am new to IONIC , creating push notification application.
The application platform added successfully in windows for android, but in mac I failed with this message.
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova platform add ios --save (exit code 1):
Using cordova-fetch for cordova-ios@^4.4.0
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.onebcg.pushtest
Name: MyApp
iOS project created with cordova-ios@4.4.0
Installing "phonegap-plugin-push" for ios
Failed to install 'phonegap-plugin-push': undefined
Error: /Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)
Usage:
$ pod COMMAND
CocoaPods, the Cocoa library package manager.
Commands:
+ cache Manipulate the CocoaPods cache
+ env Display pod environment
+ init Generate a Podfile for the current directory
+ install Install project dependencies according to versions from a
Podfile.lock
+ ipc Inter-process communication
+ lib Develop pods
+ list List pods
+ outdated Show outdated project dependencies
+ repo Manage spec-repositories
+ setup Setup the CocoaPods environment
+ spec Manage pod specs
+ update Update outdated project dependencies and create new Podfile.lock
Options:
--silent Show nothing
--version Show the version of the tool
--verbose Show more debugging information
--no-ansi Show output without ANSI codes
--help Show help banner of specified command
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:47:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'
oneadmins-iMac:pustTest onebcg$ sudo cordova platform add ios
Password:
Sorry, try again.
Password:
Using cordova-fetch for cordova-ios@^4.4.0
Error: Platform ios already added.
oneadmins-iMac:pustTest onebcg$
[Restored May 19, 2017, 4:22:09 PM]
Last login: Fri May 19 16:21:57 on console
oneadmins-iMac:pustTest onebcg$
[Restored May 19, 2017, 4:32:11 PM]
Last login: Fri May 19 16:31:46 on console
oneadmins-iMac:pustTest onebcg$ sudo ionic build ios
Password:
The build command has been renamed. To find out more, run:
ionic cordova build --help
oneadmins-iMac:pustTest onebcg$ sudo ionci cordova build ios
sudo: ionci: command not found
oneadmins-iMac:pustTest onebcg$ sudo ionic cordova build ios
Using cordova-fetch for cordova-ios@^4.4.0
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.onebcg.pushtest
Name: MyApp
iOS project created with cordova-ios@4.4.0
Installing "phonegap-plugin-push" for ios
Failed to install 'phonegap-plugin-push': undefined
Error: /Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)
Usage:
$ pod COMMAND
CocoaPods, the Cocoa library package manager.
Commands:
+ cache Manipulate the CocoaPods cache
+ env Display pod environment
+ init Generate a Podfile for the current directory
+ install Install project dependencies according to versions from a
Podfile.lock
+ ipc Inter-process communication
+ lib Develop pods
+ list List pods
+ outdated Show outdated project dependencies
+ repo Manage spec-repositories
+ setup Setup the CocoaPods environment
+ spec Manage pod specs
+ update Update outdated project dependencies and create new Podfile.lock
Options:
--silent Show nothing
--version Show the version of the tool
--verbose Show more debugging information
--no-ansi Show output without ANSI codes
--help Show help banner of specified command
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:47:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'
I just solved this issue.
You need to install pod files for push notification in OSX.
you need to use this command âpod installâ at path âproject/platforms/iosâ.
make sure you have the file named Podfile or pods.json
This doesnât really make sense. If you have Ionic CLI v3 or v2.2.3 installed makes no difference for plugin installation (besides the command to use). Both just pass it off to Cordova in the background to execute the command.
In my case it worked, because the cause of issue can be different as in my case it was some plugins version issue. As it was fixed when I reinstall the ionic to lower version which matched with the cordova plugin which I installed in previous case
Sorry, I am happy for you that it worked, but Ionic CLI (v2 and v3) has no connection to a specific cordova version, plugin version or anything - that is all completely independent of Ionic CLI.
Hi,
I have the same issue, someone solved it?
I got this error: "Plugin doesnât support this projectâs cordova-ios version. cordova-ios: 4.3.1, failed version requirement: >=4.4.0"
and canât update the cordova-ios version
Hi,
when I tried to add âcordova-plugin-fcmâ plugin I got âError: Invalid data, chunk must be a string or buffer, not objectâ, do you know what is mean?
Thanks!
@ravi_sojitra Thanks it seems this will work. But while running it in simulator I faced this error
017-06-01 17:41:29.625 MyFCMApp[4325] [Firebase/Core][I-COR000009] The GOOGLE_APP_ID either in the plist file âGoogleService-Info.plistâ or the one set in the customized options is invalid. If you are using the plist file, use the iOS version of bundle identifier to download the file, and do not manually edit the GOOGLE_APP_ID. You may change your appâs bundle identifier to â(null)â. Or you can download a new configuration file that matches your bundle identifier from https://console.firebase.google.com/ and replace the current one.
2017-06-01 17:41:29.632 MyFCMApp[4325:59891] *** Terminating app due to uncaught exception âcom.firebase.coreâ, reason: âConfiguration fails. It may be caused by an invalid GOOGLE_APP_ID in GoogleService-Info.plist or set in the customized options.â
*** First throw call stack:
(
0 CoreFoundation 0x00000001039f9d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010343221e objc_exception_throw + 48
2 CoreFoundation 0x0000000103a632b5 +[NSException raise:format:] + 197
3 MyFCMApp 0x00000001028ef6ed +[FIRApp addAppToAppDictionary:] + 371
4 MyFCMApp 0x00000001028eec98 +[FIRApp configureDefaultAppWithOptions:sendingNotifications:] + 285
5 MyFCMApp 0x00000001028ee9cc +[FIRApp configure] + 302
6 MyFCMApp 0x00000001028857ef -[AppDelegate(MCPlugin) application:customDidFinishLaunchingWithOptions:] + 767
7 UIKit 0x000000010572c3c2 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 290
8 UIKit 0x000000010572dd47 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4236
9 UIKit 0x00000001057340ed -[UIApplication _runWithMainScene:transitionContext:completion:] + 1731
10 UIKit 0x000000010573126d -[UIApplication workspaceDidEndTransaction:] + 188
11 FrontBoardServices 0x00000001091776cb FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24
12 FrontBoardServices 0x0000000109177544 -[FBSSerialQueue _performNext] + 189
13 FrontBoardServices 0x00000001091778cd -[FBSSerialQueue _performNextFromRunLoopSource] + 45
14 CoreFoundation 0x000000010399e761 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
15 CoreFoundation 0x000000010398398c __CFRunLoopDoSources0 + 556
16 CoreFoundation 0x0000000103982e76 __CFRunLoopRun + 918
17 CoreFoundation 0x0000000103982884 CFRunLoopRunSpecific + 420
18 UIKit 0x000000010572faea -[UIApplication _run] + 434
19 UIKit 0x0000000105735c68 UIApplicationMain + 159
20 MyFCMApp 0x0000000102883261 main + 65
21 libdyld.dylib 0x00000001049a768d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
I have compared the bundle id which is right.
Can you please help me out to fix this?
Thanks
@ravi_sojitra I already done this, but didnât work.
I think I should create new bundle id and then new project in firebase console and try again.
Also I moved with APN auth .p8 certificate, so that now I donât care about ssl certificates etc.
Did you upload .p12 development and ditribution certificate in firebase while linking ios app?
Because without that youâre not gonna get notification.
I faced a server error while uploading .p12 and prvisonal files. Put the bug to FCM support. They asked me to use auth p8 based certification as its more easy way of authentication. I did, but still I am facing same issue on running in simulator