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

NSInvalidArgumentException', reason: '+[NSData gul_dataByGzippingData:error:] #14276

Open
shokarta opened this issue Dec 19, 2024 · 2 comments
Open

Comments

@shokarta
Copy link

Description

Hello,

initialy I have opened another issue here but it was moved as 1670 C++ SDK issues, way later i opened bug report on your support page.
via this 10326583 case I was told that after team elaboration it should be properly placed to iOS SDK, here...

so please let me summarize everything:

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

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

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

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
therefore i consider ObjC is used well, and without it it realy builds just fine

Its realy crashes at the very first run after fresh install on iOS (Android is fine, no issue whatsoever), 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

  • which i believe its new token registration

so the crash happens only on iOS when calling initialize(), if i wont initialize then all is fine, no crash, however no token registration...

Reproducing the issue

extract attached project (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/

Firebase SDK Version

c++ 12.5.0, iOS 11.6.0 (older versions has no difference)

Xcode Version

16.2

Installation Method

Zip

Firebase Product(s)

Analytics, Messaging

Targeted Platforms

iOS

Relevant Log Output

STARTUP 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

BACKTRACE:
* thread #12, queue = 'com.apple.root.utility-qos', stop reason = hit Objective-C exception
* frame #0: 0x0000000186f951ec libobjc.A.dylibobjc_exception_throw frame #1: 0x0000000189b72008 CoreFoundation +[NSObject (NSObject) doesNotRecognizeSelector:] + 364 frame #2: 0x0000000189a1c5b8 CoreFoundation___forwarding___ + 1560
frame #3: 0x0000000189a1bee0 CoreFoundation _CF_forwarding_prep_0 + 96 frame #4: 0x0000000104aa73bc Filmtoromerged Foundation.Data.zipped() throws -> Foundation. Data + 112
frame #5: 0x0000000104aa6aac Filmtoro Foundation.Data.zipped() throws -> Foundation.Data + 40
frame #6: 0x0000000104aa5d2c Filmtoro FirebaseCore Internal.HeartbeatsPayload.headerValue() -> Swift.String + 292
frame #7: 0x0000000104a9c5a4 Filmtoro@objc FirebaseCore Internal. ObjC_HeartbeatsPayload.headerValue()-> Swift.String + 44 frame #8: 0x0000000104ac0b2c Filmtoro FIRHeaderValueFromHeartbeatsPayload + 44
frame #9: 0x0000000104ac0d1c Filmtoro-[FIRHeartbeatLogger headerValue] + 32 frame #10: 0x0000000104aae890 Filmtoro__96-[FIRInstallationsAPIService requestWithURL:HTTPMethod: bodyDict: refreshToken: additional Headers:]_block_invoke + 364 frame #11: 0x0000000104a98154 Filmtoro__38+[FBL Promise (DoAdditions) onQueue: do:]_block_invoke + 40
frame #12: 0x000000010bb4888c libdispatch.dylib_dispatch_call_block_and_release + 32 frame #13: 0x000000010bb4a578 libdispatch.dylib_dispatch_client_callout + 20
frame #14: 0x000000010bb5f11c libdispatch.dylib _dispatch_root_queue_drain + 1404 frame #15: 0x000000010bb5f724 libdispatch.dylib_dispatch_worker_thread2 + 188
frame #16: 0x00000002145db644 libsystem_pthread.dylib_pthread_wqthread + 228

and when I click to continue, then I have the error:
*** 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

If using Swift Package Manager, the project's Package.resolved

No response

If using CocoaPods, the project's Podfile.lock

No response

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@paulb777
Copy link
Member

Sorry about the multiple redirections.

Looking at the xcode project file - I don't see the -ObjCoption inOther Linker Flags. As specified in the zip distribution instructions`, it must be there and it being missing is almost certainly the cause of the linker error.

We cannot help with cmake issues in this repo and you can refer the case number back to this comment to follow up on an issue in firebase-cpp-sdk.

Image

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

3 participants