dpa99c/cordova-plugin-firebasex

iOS App crashs with Firebasex 16.2.0/16.3.0

Opened this issue ยท 17 comments

Bug report

Apps that incorporate Firebasex 16.2.0/16.3.0 on iOS crash when launching the app.
If it is a debug run from Xcode, it does not crash.

On the other hand, Firebasex 16.1.0 does not crash.
What are the possible causes?

CHECKLIST

  • I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
  • I have checked that no similar issues (open or closed) already exist.

Steps to reproduce:

  1. create a corodva project and add the firebasex 16.3.0( or 16.3.0) plugin.
  2. exec cordova prepare ios and exec cordova compile --device --codeSignIdentity="iPhone Developer" --provisioningProfile="xxxxx".
  3. install the created ipa file into the iphone device.
  4. launch the app. and then the app crashes soon. (No app pages are shown)

Screenshots

Environment information

  • Cordova CLI version
    • cordova -v 12.0.0 (cordova-lib@12.0.1)
  • Cordova platform version
    • cordova platform ls ios 7.0.1
  • Plugins & versions installed in project (including this plugin)
    • cordova plugin ls
      • cordova-plugin-firebasex 16.3.0 "Google Firebase Plugin"
  • Dev machine OS and version, e.g.
    • OSX
      • sw_vers 13.6.1

Runtime issue

  • Device details
    • iPhone SE2
  • OS details
    • iOS 16.7.2

iOS build issue:

  • Node JS version
    • node -v
  • XCode version
    • 15.1.0



Other information:

pod version is

% pod --version
1.14.3

Some environments, this issue does not happen.
I guess that is because cocoapods modules are cached.

config.xml is not changed from the default one.

If I use the following build.json

{
    "ios": {
        "debug": {
            "buildFlag": [
                "-quiet",
                "IPHONEOS_DEPLOYMENT_TARGET=15.0"
            ]
        }
    }
}

this issue does not happen.

Same here.
This issue occurred in versions 16.3.0 and 16.4.0, but it didn't happen in version 16.1.0.

[Environment]

  • cordova: 11.0.0
  • iOS platform: 6.2.0
  • XCode: 14.2.0

Probably same here.

  • cordova: 12.0.0
  • Cordova platform iOS: 7.0.1
  • XCode: 15.0.1
  • cordova-plugin-firebasex: 16.4.0-cli
  • iOS: 17.2.1

same here

What does the console outputs when app is crashing?

Same issue here, setting the compile target to 15.0 does solve the problem, however what usability issues does this present to app users/customers?

Also - this does not crash the simulator, only crashes on my device (ProMax 14 latest IOS version)

I've fixed this issue by specifying newer firebase sdk version in package.json :
"IOS_FIREBASE_SDK_VERSION":"10.22.0",

@risinghero I tried this and got:

CocoaPods could not find compatible versions for pod "FirebaseInAppMessaging": In Podfile: FirebaseInAppMessaging (= 10.22.0)

Turns out FirebaseInAppMessaging only publishes on CocoaPods with "-beta" versions currently. (which is why this project's plugin.xml has "10.17.0-beta" for this pod only) were you able to get around this without editing your podfile? I'm thinking maybe a hook which adds "-beta" to that pod version but wondering if there is an easier way?

btw: I have the kernel EXC_BAD_ACCESS crash from building with xcode 15.3 (firebase/firebase-ios-sdk#12457) so my issue may be different from OP since they are showing versions prior to 15.3 in comments above. Sounds like firebase 10.22 fixes my issue as well though.

@risinghero I tried this and got:

CocoaPods could not find compatible versions for pod "FirebaseInAppMessaging": In Podfile: FirebaseInAppMessaging (= 10.22.0)

Turns out FirebaseInAppMessaging only publishes on CocoaPods with "-beta" versions currently. (which is why this project's plugin.xml has "10.17.0-beta" for this pod only) were you able to get around this without editing your podfile? I'm thinking maybe a hook which adds "-beta" to that pod version but wondering if there is an easier way?

If you're interested, I've formed the repo and added Consent Mode V2 and bumped the pod versions for ios at 10.22.0 https://github.com/pinguluk/cordova-plugin-firebasex/tree/develop

If you don't want to use the fork, you can edit the plugin.xml file from the plugins/cordova-plugin-firebasex and bump the pods versions yourself (although I don't know how to trigger these changes to be applied automatically to platform/ios, as they are applied only when you initially add the plugin to the project; you can find the 10.17.0 references in the platforms/ios and update them to 10.22.0 manually and keep 10.22.0-beta for Firebase-InAppMessages and then just run "pod install" command)

Forgot to mention about the crash for Xcode 15.3, I've explained here what should you do in this case nanopb/nanopb#949 (comment)

Thanks. Yeah was just wondering if there was some other built in way I was missing of overriding that pod version. Was trying to do it in a automatic/reproducible way for teammates so I may go the cordova hook route.

Forgot to mention about the crash for Xcode 15.3, I've explained here what should you do in this case nanopb/nanopb#949 (comment)

The fix in 10.22.1 is only if you are using FirebaseAnalyticsOnDeviceConversion which at least this particular project does not: https://github.com/dpa99c/cordova-plugin-firebasex/blob/master/plugin.xml#L162 so 10.22.0 should be fine no?

Thanks. Yeah was just wondering if there was some other built in way I was missing of overriding that pod version. Was trying to do it in a automatic/reproducible way for teammates so I may go the cordova hook route.

Forgot to mention about the crash for Xcode 15.3, I've explained here what should you do in this case nanopb/nanopb#949 (comment)

The fix in 10.22.1 is only if you are using FirebaseAnalyticsOnDeviceConversion which at least this particular project does not: https://github.com/dpa99c/cordova-plugin-firebasex/blob/master/plugin.xml#L162 so 10.22.0 should be fine no?

I would stick to 10.22.0 and Xcode 15.2 for now and wait for 10.23.0 and just then update Xcode to 15.3

Thanks. Yeah was just wondering if there was some other built in way I was missing of overriding that pod version. Was trying to do it in a automatic/reproducible way for teammates so I may go the cordova hook route.

Forgot to mention about the crash for Xcode 15.3, I've explained here what should you do in this case nanopb/nanopb#949 (comment)

The fix in 10.22.1 is only if you are using FirebaseAnalyticsOnDeviceConversion which at least this particular project does not: https://github.com/dpa99c/cordova-plugin-firebasex/blob/master/plugin.xml#L162 so 10.22.0 should be fine no?

10.22.0 is fine. Solves this problem.

@risinghero I tried this and got:

CocoaPods could not find compatible versions for pod "FirebaseInAppMessaging": In Podfile: FirebaseInAppMessaging (= 10.22.0)

Turns out FirebaseInAppMessaging only publishes on CocoaPods with "-beta" versions currently. (which is why this project's plugin.xml has "10.17.0-beta" for this pod only) were you able to get around this without editing your podfile? I'm thinking maybe a hook which adds "-beta" to that pod version but wondering if there is an easier way?

btw: I have the kernel EXC_BAD_ACCESS crash from building with xcode 15.3 (firebase/firebase-ios-sdk#12457) so my issue may be different from OP since they are showing versions prior to 15.3 in comments above. Sounds like firebase 10.22 fixes my issue as well though.

I just edited manually Podfile adding -beta. Well I think that soon there will be fix so there is no need to add hook.

@risinghero I tried this and got:
CocoaPods could not find compatible versions for pod "FirebaseInAppMessaging": In Podfile: FirebaseInAppMessaging (= 10.22.0)
Turns out FirebaseInAppMessaging only publishes on CocoaPods with "-beta" versions currently. (which is why this project's plugin.xml has "10.17.0-beta" for this pod only) were you able to get around this without editing your podfile? I'm thinking maybe a hook which adds "-beta" to that pod version but wondering if there is an easier way?

If you're interested, I've formed the repo and added Consent Mode V2 and bumped the pod versions for ios at 10.22.0 https://github.com/pinguluk/cordova-plugin-firebasex/tree/develop

If you don't want to use the fork, you can edit the plugin.xml file from the plugins/cordova-plugin-firebasex and bump the pods versions yourself (although I don't know how to trigger these changes to be applied automatically to platform/ios, as they are applied only when you initially add the plugin to the project; you can find the 10.17.0 references in the platforms/ios and update them to 10.22.0 manually and keep 10.22.0-beta for Firebase-InAppMessages and then just run "pod install" command)

To trigger changes you just need to invoke cordova prepare in console. Thanks for the fork!

@risinghero I tried this and got:
CocoaPods could not find compatible versions for pod "FirebaseInAppMessaging": In Podfile: FirebaseInAppMessaging (= 10.22.0)
Turns out FirebaseInAppMessaging only publishes on CocoaPods with "-beta" versions currently. (which is why this project's plugin.xml has "10.17.0-beta" for this pod only) were you able to get around this without editing your podfile? I'm thinking maybe a hook which adds "-beta" to that pod version but wondering if there is an easier way?

If you're interested, I've formed the repo and added Consent Mode V2 and bumped the pod versions for ios at 10.22.0 https://github.com/pinguluk/cordova-plugin-firebasex/tree/develop
If you don't want to use the fork, you can edit the plugin.xml file from the plugins/cordova-plugin-firebasex and bump the pods versions yourself (although I don't know how to trigger these changes to be applied automatically to platform/ios, as they are applied only when you initially add the plugin to the project; you can find the 10.17.0 references in the platforms/ios and update them to 10.22.0 manually and keep 10.22.0-beta for Firebase-InAppMessages and then just run "pod install" command)

To trigger changes you just need to invoke cordova prepare in console. Thanks for the fork!

I've ran the "cordova prepare" command and I couldn't get it detect the new changes, as I suppose that it already detects the plugin as being already added and that's why everytime I delete the plugin via "cordova plugin remove" and then add it back, to have the new changes

Ica be worng but when I changed

@risinghero I tried this and got:
CocoaPods could not find compatible versions for pod "FirebaseInAppMessaging": In Podfile: FirebaseInAppMessaging (= 10.22.0)
Turns out FirebaseInAppMessaging only publishes on CocoaPods with "-beta" versions currently. (which is why this project's plugin.xml has "10.17.0-beta" for this pod only) were you able to get around this without editing your podfile? I'm thinking maybe a hook which adds "-beta" to that pod version but wondering if there is an easier way?

If you're interested, I've formed the repo and added Consent Mode V2 and bumped the pod versions for ios at 10.22.0 https://github.com/pinguluk/cordova-plugin-firebasex/tree/develop
If you don't want to use the fork, you can edit the plugin.xml file from the plugins/cordova-plugin-firebasex and bump the pods versions yourself (although I don't know how to trigger these changes to be applied automatically to platform/ios, as they are applied only when you initially add the plugin to the project; you can find the 10.17.0 references in the platforms/ios and update them to 10.22.0 manually and keep 10.22.0-beta for Firebase-InAppMessages and then just run "pod install" command)

To trigger changes you just need to invoke cordova prepare in console. Thanks for the fork!

I've ran the "cordova prepare" command and I couldn't get it detect the new changes, as I suppose that it already detects the plugin as being already added and that's why everytime I delete the plugin via "cordova plugin remove" and then add it back, to have the new changes

I can be wrong but when I changed library version in package.json (not config.xml) and invoked "cordova prepare" library versions in podfile also changed.

The latest version 16.5 has still this issue.
But we can resolve this issue by setting appropriate deployment-target like

    <platform name="ios">
        <preference name="deployment-target" value="12.2"/>
    </platform>