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

Firebase messaging caused iOS Unity app crash on startup (4.0.2, not always, rendering) #104

Closed
sigono-chao3 opened this issue Aug 22, 2017 · 3 comments

Comments

@sigono-chao3
Copy link

Hello, we installed Firebase 4.0.2 to our Unity game. And it works quite well. However, when we try to send our game for Apple review, the reviewer said our game crashed on startup. The call stack shows the app crashed somewhere in Unity Metal code, and we ended up forcing our game running on OpenGL ES3. Today we got it reproduced in house and it seems related to how Firebase invokes Unity rendering API and I would like to report it:

Unity version: 5.6.3f1 (macOS 10.12.5)
Device: iPhone5 A1429

Device log:

Aug 22 11:52:33 Sigono-de-iPhone heaven01(Foundation)[679] <Notice>: *** Assertion failure in -[UnityAppController renderingAPI], /Users/sigono/workspace/workspace/Heaven_iOS/Builds/iOS/Classes/UnityAppController Rendering.mm:138
Aug 22 11:52:33 Sigono-de-iPhone heaven01[679] <Notice>: Uncaught exception: NSInternalInconsistencyException: [UnityAppController renderingAPI] called before [UnityAppController selectRenderingApi]

Symbolicated main thread call stack

Hardware Model:      iPhone5,2
OS Version:          iPhone OS 10.2 (14C92)
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
abort() called

Filtered syslog:
None found

Last Exception Backtrace:
0   CoreFoundation                	0x1cc5cdf2 __exceptionPreprocess   126
1   libobjc.A.dylib               	0x1bebf072 objc_exception_throw   34
2   CoreFoundation                	0x1cc5cccc  [NSException raise:format:arguments:]   92
3   Foundation                    	0x1d55792c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]   88
4   heaven01                      	0x000cdb04 -[UnityAppController(Rendering) renderingAPI] (UnityAppController Rendering.mm:138)
5   heaven01                      	0x000df6b4 -[UnityAppController application:didFinishLaunchingWithOptions:] (UnityAppController.mm:247)
6   heaven01                      	0x015ed6ee firebase::messaging::AppDelegateApplicationDidFinishLaunchingWithOptions(objc_object*, objc_selector*, UIApplication*, NSDictionary*)   398
7   UIKit                         	0x21d7a72e -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:]   394
8   UIKit                         	0x21f86e24 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:]   3740
9   UIKit                         	0x21f8c442 -[UIApplication _runWithMainScene:transitionContext:completion:]   1708
10  UIKit                         	0x21f9f12c __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke.3141   36
11  UIKit                         	0x21f89828 -[UIApplication workspaceDidEndTransaction:]   142
12  FrontBoardServices            	0x1e5529ae __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__   14
13  FrontBoardServices            	0x1e552868 -[FBSSerialQueue _performNext]   216
14  FrontBoardServices            	0x1e552b52 -[FBSSerialQueue _performNextFromRunLoopSource]   40
15  CoreFoundation                	0x1cc18716 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__   8
16  CoreFoundation                	0x1cc18220 __CFRunLoopDoSources0   434
17  CoreFoundation                	0x1cc164f6 __CFRunLoopRun   758
18  CoreFoundation                	0x1cb6552e CFRunLoopRunSpecific   482
19  CoreFoundation                	0x1cb6533c CFRunLoopRunInMode   100
20  UIKit                         	0x21d73ebc -[UIApplication _run]   724
21  UIKit                         	0x21d6e54c UIApplicationMain   146
22  heaven01                      	0x000c55ea main (main.mm:33)
23  libdyld.dylib                 	0x1c32f506 _dyld_process_info_notify_release   24

Thank you very much for your help

@stewartmiles
Copy link
Contributor

Hi @sigono-chao3 we don't invoke Unity's rendering API directly, we do however swizzle the didFinishLaunchingWithOptions app delegate method present to setup messaging, dynamic links and invites in the call stack you've shared.

Any chance you have additional information to help us reproduce?

The assert does look very dodgy.

Aug 22 11:52:33 Sigono-de-iPhone heaven01[679] : Uncaught exception: NSInternalInconsistencyException: [UnityAppController renderingAPI] called before [UnityAppController selectRenderingApi]

Suggests that the call order is the problem here in Unity's framework. Are you sure this isn't a known issue for Unity 5.6.3f1 on iOS?

@stewartmiles
Copy link
Contributor

@sigono-chao3 any luck finding the root cause of your issue?

@sigono-chao3
Copy link
Author

@stewartmiles
Hello, sorry we don't have any good news here. It seems kind of random and we are still waiting for Unity about this issue. Please close this issue if you would like to. Thank you very much for your help.

@firebase firebase locked and limited conversation to collaborators Oct 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants