havesource / cordova-plugin-push

Register and receive push notifications
MIT License
150 stars 283 forks source link

PR 185 breaks iOS build, due to firebase pod incompatibility (with dynamic-links?) #206

Closed Mister-CK closed 2 years ago

Mister-CK commented 2 years ago

Bug Report

pr 185 breaks the iOS build

Expected Behaviour

For the application to build correctly and without errors

Actual Behaviour

build fails, see logs below

Reproduce Scenario (including but not limited to)

build iOS with this plugin installed. It might only be a problem when you also have dynamic links installed

Steps to Reproduce

build iOS with this plugin installed. It might only be a problem when you also have dynamic links installed

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

cordova 10.0.0 cordova-android 10.2.1 cordova-ios 6.2.0

(Android) Device Vendor (e.g. Samsung, HTC, Sony...)

NA

cordova info Printout

package.json:

--- Start of Cordova JSON Snippet --- { "plugins": { "cordova-plugin-dialogs": {}, "cordova-plugin-statusbar": {}, "cordova-plugin-splashscreen": {}, "cordova-plugin-appsettings": {}, "cordova-plugin-device": {}, "cordova-plugin-x-toast": {}, "cordova-sharingreceptor": {}, "com.omarben.inappreview": {}, "cordova-plugin-screen-orientation": {}, "cordova-plugin-native-spinner": {}, "cordova-plugin-file": {}, "cordova-plugin-apprate": {}, "cordova-plugin-file-opener2": { "ANDROID_SUPPORT_V4_VERSION": "27.+" }, "cordova-plugin-camera": { "ANDROID_SUPPORT_V4_VERSION": "27.+" }, "cordova-plugin-customurlscheme": { "URL_SCHEME": "", "ANDROID_SCHEME": " ", "ANDROID_HOST": " ", "ANDROID_PATHPREFIX": "/" }, "cordova-plugin-appavailability": {}, "cordova-plugin-qrscanner": {}, "cordova-plugin-app-version": {}, "cordova.plugins.diagnostic": { "ANDROID_SUPPORT_VERSION": "28.+" }, "cordova-custom-config": {}, "cordova-plugin-browsertab": { "CUSTOM_TAB_COLOR_RGB": "#ffffff", "ANDROID_SUPPORT_TABS_VERSION": "26.+" }, "cordova-plugin-add-swift-support": {}, "cordova-universal-links-plugin": {}, "cordova-plugin-inappbrowser": {}, "cordova-plugin-chooser": {}, "cordova-plugin-androidx-adapter": {}, "cordova-plugin-onegini": {}, "cordova-plugin-filepath": {}, "cordova-plugin-contentprovider": {}, "cordova-plugin-file-transfer-ios-fix": {}, "cordova-plugin-firebase-dynamiclinks": { "APP_DOMAIN_NAME": "app.page.link", "APP_DOMAIN_PATH": "/", "ANDROID_FIREBASE_DYNAMICLINKS_VERSION": "20.1.+" }, "cordova-plugin-android-fingerprint-auth": {}, "cordova-plugin-touch-id": {}, "cordova-clipboard": {}, "cordova-plugin-media": {}, "cordova-plugin-networkinterface": {}, "cordova-plugin-ms-appinsights": { }, "@globules-io/cordova-plugin-ios-xhr": {}, "cordova-plugin-x-socialsharing": {}, "cordova-open-native-settings": {}, "cordova-plugin-start-partner-app": {}, "@havesource/cordova-plugin-push": { "ANDROIDX_CORE_VERSION": "1.6.+", "FCM_VERSION": "23.+" } }, "platforms": [ "ios", "android" ] }

Sample Push Data Payload

NA

Sample Code that illustrates the problem

NA

Logs taken while reproducing problem

Analyzing dependencies [!] CocoaPods could not find compatible versions for pod "Firebase/Analytics": In Podfile: Firebase/Analytics (~> 6.32.2)

None of your spec sources contain a spec satisfying the dependency: Firebase/Analytics (~> 6.32.2).

You have either:

erisu commented 2 years ago

pr 185 breaks the iOS build

Can you please explain why or how you think an Android PR has broken the iOS build when there is no iOS configurations or code changes?

I am trying to understand how it would happen.

Or did you write down the wrong PR number?

erisu commented 2 years ago

iOS has configured

<preference name="IOS_FIREBASE_MESSAGING_VERSION" default="~> 8.1.1"/>

Which is not from that PR. But that is for the Firebase/Messaging pods dependency.

This plugin does not use Firebase/Analytics

What happens if you run pod repo update to update your pods repository?

Mister-CK commented 2 years ago

pr 185 breaks the iOS build

Can you please explain why or how you think an Android PR has broken the iOS build when there is no iOS configurations or code changes?

I am trying to understand how it would happen.

Or did you write down the wrong PR number?

The reason I think this pr broke the plugin is that this is the only change I made. If I set the version for this plugin back to 3.0.1, then the error doesn't occur (but push-notifications do not work due to targetSDK=31 incompatibility).

Maybe it's the FCM_VERSION = 23 that causes the issue.

erisu commented 2 years ago

I took a quick look at the cordova-plugin-firebase-dynamiclinks plugin since you refered to dynamic-links in the title.

I went back version by version and identified that your using a really old plugin v4.8.0 which has defined two thing in their configurations.

<dependency id="cordova-plugin-firebase-analytics" version="~4.5.0"/>

and

<preference name="IOS_FIREBASE_DYNAMICLINKS_VERSION" default="~> 6.32.2"/>

<podspec>
    <config>
        <source url="https://cdn.cocoapods.org/" />
    </config>
    <pods>
        <pod name="Firebase/DynamicLinks" spec="$IOS_FIREBASE_DYNAMICLINKS_VERSION" />
    </pods>
</podspec>

Basically that that explain where the version 6.32.2 is coming from and also the Analytics requirement which also has the same definition for the version requirement.

There is nothing we can do in this plugin.

Since our version is newer, your going to have to upgrade the dynamic links plugin or fork this repository and make the changes you need to support your needs. But beyond that theres nothing we can do when plugins causes library conflicts due to different imported versions.

From quick glance you might be able to ugrade the cordova-plugin-firebase-dynamiclinks@6.1.3 (or 6.0.0??) and it might work. But if using anything newer, there might be the possbility of the same issue but in reverse. Their plugin being newer then ours.

Our plugin defined ~> 8.1.1 and in their plugin at 6.1.3 has defined version ~> 8.8.0. The ~> should mean specifying a version 'up to next major | minor | patch'.

Mister-CK commented 2 years ago

@erisu !hanks for looking into this! I understand you cannot accommodate of old plugins. This was the only combination we found where all the pods were not in conflict with each other. updating the dynamic links plugin to the version you suggested gives me another pod error. For now I'll just use a patch to get push-notifications to work again. And I'll put a story on our backlog to fix this properly.