dpa99c / cordova-plugin-firebasex

Cordova plugin for Google Firebase
MIT License
570 stars 457 forks source link

iOS App crashs with Firebasex 16.2.0/16.3.0 #860

Open knaito-asial opened 4 months ago

knaito-asial commented 4 months ago

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

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

Runtime issue

iOS build issue:



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.

MizuhoMorohoshi commented 4 months ago

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]

satoshionoda commented 3 months ago

Probably same here.

munenari commented 2 months ago

same here

pinguluk commented 2 months ago

What does the console outputs when app is crashing?

Fever905 commented 2 months ago

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)

risinghero commented 2 months ago

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

tay-j-kohn commented 2 months ago

@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 (https://github.com/firebase/firebase-ios-sdk/issues/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.

pinguluk commented 2 months ago

@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)

pinguluk commented 2 months ago

Forgot to mention about the crash for Xcode 15.3, I've explained here what should you do in this case https://github.com/nanopb/nanopb/issues/949#issuecomment-1997558415

tay-j-kohn commented 2 months ago

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?

pinguluk commented 2 months ago

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

risinghero commented 2 months ago

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 commented 2 months ago

@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 commented 2 months ago

@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!

pinguluk commented 1 month ago

@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

risinghero commented 1 month ago

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.