[Bug] NSInvalidArgumentException', reason: '+[NSData gul_dataByGzippingData:error:]: unrecognized selector sent to class 0x1f88ab900'
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- cmake, cpp, ios
调研方向
使用最小复现项目和列出的 Firebase C++ 12.4.0 与 Firebase iOS 11.5.0 压缩包,然后在卸载应用后于真实 iOS 设备上复现。先从 Projects/Sources/firebase_test/ 和生成的 Xcode 项目开始,注意 CMake target_link_options 以及第一次和第二次获取 FCM token 的区别。完成的标准是确定 NSData selector crash 的原因,并确认首次启动能够干净完成。
由索引模型根据 Issue 内容生成。
描述
[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):
which correspond to what it gives me during the very first startup:
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:
- without that, all builds fine
I have filled iOS SDK bug https://github.com/firebase/firebase-ios-sdk/issues/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/
- 主要语言
- C++
- 星标
- 325
- 派生
- 136
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 7
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/firebase-cpp-sdk 的其他 Issue
-
new type: question
难度 2/5 1-3 小时 新手友好度 85/100
firebase/firebase-cpp-sdk#1926 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
firebase/firebase-cpp-sdk#1905 · 2 条评论 ·
维护者通常 3 天内回复
-
new type: question
难度 3/5 1-2 天 新手友好度 45/100
firebase/firebase-cpp-sdk#1934 ·
维护者通常 3 天内回复
-
api: firestore
难度 5/5 一周以上 新手友好度 35/100
firebase/firebase-cpp-sdk#1920 · 3 条评论 ·
维护者通常 3 天内回复
-
难度 3/5 1-2 天 新手友好度 70/100
firebase/firebase-cpp-sdk#1904 · 1 条评论 ·
维护者通常 3 天内回复
查看 firebase/firebase-cpp-sdk 的全部 Issue
相似的 Issue
-
Incorrect Link in README.md可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 95/100
flameshot-org/flameshot#4996 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
utopia-rise/godot-jvm#1004 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
new contributor
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复