Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] NSInvalidArgumentException', reason: '+[NSData gul_dataByGzippingData:error:]: unrecognized selector sent to class 0x1f88ab900' #1670

Open
shokarta opened this issue Nov 10, 2024 · 3 comments

Comments

@shokarta
Copy link

shokarta commented Nov 10, 2024

[REQUIRED] Please fill in the following fields:

  • Pre-built SDK from the website or open-source from this repo: prebuild release
  • Firebase C++ SDK version: 12.2.0
  • Problematic Firebase Component: Messaging (Auth, Database, etc.)
  • Other Firebase Components in use: Analytics (Auth, Database, etc.)
  • Platform you are using the C++ SDK on: Mac (Mac, Windows, or Linux)
  • Platform you are targeting: iOS (iOS, Android, and/or desktop)

Startup log

LOG: FCM: Loading UIApplication FIRFCM category
[FirebaseCore] [I-COR000005] No app has been configured yet.
[FirebaseCore] [I-COR000005] No app has been configured yet.
Setting up ios 10 message delegate.
[FirebaseCore] [I-COR000005] No app has been configured yet.
11.3.0 [FirebaseCore] [I-COR000003] The default Firebase app has not yet been configured. Add *FirebaseApp.configure() to your application initialization. This can be done in in the App Delegate's application(_: did FinishLaunchingWithOptions:) (or the @main struct's initializer in SwiftUI). Read more: https://firebase.google.com/docs/ios/setup#initialize_firebase_in_your_app
11.3.0 [FirebaseCore][I-COR000005] No app has been configured yet.
11.3.0 [FirebaseMessaging] [I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at: https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging to ensure proper integration.
stale focus object 0x0, doing manual update
Errors found! Invalidating cache...
fopen failed for data file: errno = 2 (No such file or directory)
Errors found! Invalidating cache...
FCM: Initialize Firebase Messaging FCM: Using FCM senderID 933253518766
FCM: Retrieve registration token
OnTokenReceived xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
FCM: new registration token received.
FCM: Retrieve registration token
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSData gul_dataByGzippingData: error:]: unrecognized selector sent to class 0x1f88ab900'
*** First throw call stack:
(0x194af87cc 0x191dcb2e4 0x194bfe75c 0x194a96b08 0x194a96430 0x102645848 0x102644f38 0x1026441b8 0x10263ac9c 0x10265ea18 0x10265ec08 0x10264c824 0x102636bb0 0x109568a30 0x10956a71c 0x10957f010 0x10957f618 0x21cfd3c40 0x21cfd0488)
libc++abi: terminating due to uncaught exception of type NSException

[REQUIRED] Please describe the issue here:

upon app startup, this is the crash... its always only when upgrading the app or installing new fresh (after previous uninstall)... second start is good... users occasinaly reported another crash on startup after several apps open

Generating the project via Cmake, after project configure i open xcproject from xcode and build it.
I dont know what changed, but month ago was everything fine... didnt change anything.
I cant say for sure, but its appearing to crash on first startup when the common popup to approve notifications permisison opens... so it does not continue till i click accept/reject and it crash in meanwhile

iOS SDK 11.3.0 (but tried 11.4.0 with same result)
Xcode 16.1
building on iOS 18.1

in Testflight crash reports, i always see this only case reason from several devices and several iOS version of those devices):
image

which correspond to what it gives me during the very first startup:
image

UPDATE: And I also see which is strange, that it always fails on SECOND retrieving of FCM token... why it retries twice?
second run is again OK, it just make two different registration tokens.... however i initialize() just once

UPDATE 2: i tried to kill the app when it crashes the first time (before i approve/reject notification permittion), so i force second start to pop it up again... so it does pop it up again on second start and all works fine... no crash... so its not realy the popup window for permititon as i expected

It is true i didnt set explicitly -ObjC into other flags, however I tried to set OBJC and OBJCXX language in cmake project() as well as enable_language() for OBJC and OBJCCXX.
this has no effect.
On the other hand, if I set explicitly:
target_link_options(${TARGET_NAME} PRIVATE -ObjC)
this gives me build error:
image

  • without that, all builds fine

I have filled iOS SDK bug firebase/firebase-ios-sdk#14072, but they closed at at redirect me here to file it here as they dont support cmake.

MINIMAL REPRODUCING EXAMPLE:
extract attached project https://drive.google.com/file/d/1U-ADaeE6wbsHhOPDzl51TvD_htNe0Q-T/view?usp=sharing (more then 25mb, therefore must use google driv to share)
into Projects/extralibs/firebase_cpp_sdk please extract content of https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_12.4.0.zip
into Projects/extralibs/firebase_ios_sdk please extract content of https://github.com/firebase/firebase-ios-sdk/releases/download/11.5.0/Firebase.zip
open xcode and open Projects/Builds/build-firebase_test-Qt_6_7_3_for_iOS/Filmtoro.xcodeproj
run on real device and thats it... every time when its first build (so after each build uninstall app from device) it reproduces the crash.
tested only on real device not simulator, and its actually not even configured for simulator
note: sorces of the project can be found in Projects/Sources/firebase_test/

@shokarta
Copy link
Author

EDIT: happens also with c++ sdk 12.4.0 (12.3.0 cant build due to linking issues), and ios sdk tried 11.0.0, 11.2.0, 11.3.0, 11.4.0 and 11.5.0, all of them same thing.
Its only first run after fresh install on iOS (Android is fine), however from time to time (only occasionaly) this happens when i click on push notification and the app opens, or even the very normal furt on the application

@shokarta
Copy link
Author

shokarta commented Dec 2, 2024

today I tried to load firebase as usual, only remove the line initialize();, so on first build and start it didnt request a token and app didnt crash... next build i used again the initialize() so the build and run crashed for the same reason, however next (second) run went through just fine and app works

@shokarta
Copy link
Author

shokarta commented Dec 3, 2024

reproducable minimalistic example attech, described in issue description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants