phonegap/phonegap-plugin-push

iOS: No able to co-existing with cordova-plugin-firebase-analytics

xinfengmich opened this issue · 4 comments

Expected Behaviour

Install both phonegap-plugin-push and cordova-plugin-firebase-analytics in the same project.
Also see #2796

Actual Behaviour

cordova plugin add phonegap-plugin-push --variable FCM_VERSION=17.4.0
Installing "phonegap-plugin-push" for ios
"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.
Running command: pod install --verbose
Failed to install 'phonegap-plugin-push': Error: pod: Command failed with exit code 1
at ChildProcess.whenDone (/Users/xinfeng/Documents/learn/sample/node_modules/cordova-common/src/superspawn.js:135:23)
at ChildProcess.emit (events.js:209:13)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
pod: Command failed with exit code 1
[ERROR] An error occurred while running subprocess cordova.

    cordova plugin add phonegap-plugin-push --variable FCM_VERSION=17.4.0 exited with exit code 1.
    
    Re-running this command with the --verbose flag may provide more information.

$ pod install
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "FirebaseAnalytics":
In snapshot (Podfile.lock):
FirebaseAnalytics (= 6.4.2)

In Podfile:
Firebase/Analytics (~> 6.23.0) was resolved to 6.23.0, which depends on
Firebase/Core (= 6.23.0) was resolved to 6.23.0, which depends on
FirebaseAnalytics (= 6.4.2)

FirebaseMessaging (~> 2.0.0) was resolved to 2.0.8, which depends on
  FirebaseAnalytics (~> 4.0)

Reproduce Scenario (including but not limited to)

$ cordova plugin add cordova-plugin-firebase-analytics --variable FIREBASE_ANALYTICS_VERSION="16.+"

$ cordova plugin add phonegap-plugin-push --variable FCM_VERSION="17.4.0"

Cordova CLI version and cordova platform version

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
cordova-android: ^8.0.0
cordova-ios: ^5.1.0

Plugin version

phonegap-plugin-push : 2.2.3 or 2.3.0
cordova-plugin-firebase-analytics: v0.14.0 above to the latest V4.3

Sample Push Data Payload

Sample Code that illustrates the problem

Logs taken while reproducing problem

I'm having the same problem when using both plugins, tried pop repo update and updating cocoapods version but none worked... Any workarounds?

Underlying firebase version is conflict. Check on plugin.xml, <framework src="FirebaseMessaging" type="podspec" spec="~> 2.0.0" /> is older than cordova-plugin-firebase-analytics using.

phonegap-plugin-push@2.2.3 can co-exists with cordova-plugin-firebase-analytics@0.13.0

@xinfengmich yes your solution works for iOS. however it does not for Android:

A problem occurred evaluating project ':app'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
   > All firebase libraries must be either above or below 14.0.0

Remove both, and try following
$ ionic cordova plugin add phonegap-plugin-push@2.2.3 --variable FCM_VERSION="17.4.0"
$ ionic cordova plugin add cordova-plugin-firebase-analytics@0.13.0 --variable FIREBASE_VERSION="16.0.0"