iOS 15 crash since 2nd sessions, Xcode 13

Unity 2020.3.9
Xcode 13.0
Firebase 8.2

We’ve been releasing with Unity 2020.3.9 for a several months, no problems. This release we’ve updated Xcode to version 13 and Firebase to 8.2.
And today received a report from some of our testers with black screen and closing app.

I have no iOS15 device near me to debug, but looks like received logs via Xcode. I have no luck with reproducing it on simulator.
So looking for any advice of how to understand it and where to search.

What I see from the project is that there is running logic in GULAppEnvironmentUtil.
isAppStoreReceiptSandbox(). I assume it’s part of the Firebase. After that the core logic is called:
NSURL *appStoreReceiptURL = [NSBundle mainBundle].appStoreReceiptURL;

And looks like something happened after that.

As for the reproducibility. We have a few test devices, with TF, sandboxes and iOS 15.0.1 - all are crashing during second and next sessions (not the first one).
And one personal device, without testing staff - it’s working correctly with this release.

UPD:
Testers checked build with Xcode 12.5 with same features - it’s working correctly on iOS 15.

Crash log

Incident Identifier: 0BE23EAE-BD2D-4487-9902-E86BF6197742
Hardware Model:      iPhone13,3
Process:             My_app [441]
Path:                /private/var/containers/Bundle/Application/90A535F8-D72B-4DDE-92CD-E21BB5A700BA/My_app.app/My_app
Identifier:          com.My_app
Version:             1.65 (14)
AppStoreTools:       13A227
AppVariant:          1:iPhone13,3:15
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.My_app [559]

Date/Time:           2021-10-05 13:17:32.0047 +0300
Launch Time:         2021-10-05 13:17:11.1527 +0300
OS Version:          iPhone OS 15.0.1 (19A348)
Release Type:        User
Baseband Version:    2.09.10
Report Version:      104

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


Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib            0x00000001b9a5b204 __ulock_wait + 8
1   libdispatch.dylib                 0x0000000182c83344 _dlock_wait + 56 (lock.c:326)
2   libdispatch.dylib                 0x0000000182c83274 _dispatch_once_wait + 120 (lock.c:382)
3   Foundation                        0x00000001848c08f0 -[NSCoder _walkAllowedClassListLookingForClass:forKey:allowedClasses:strictModeEnabled:alwaysEnforceExplicitSubclasses:] + 1068 (once.h:84)
4   Foundation                        0x00000001847dfabc -[NSXPCDecoder _validateAllowedClass:forKey:allowingInvocations:] + 188 (NSXPCCoder.m:744)
5   Foundation                        0x00000001849f1f28 _decodeObject + 1364 (NSXPCCoder.m:1018)
6   Foundation                        0x00000001847ca6b4 -[NSXPCDecoder _decodeObjectOfClasses:atObject:] + 148 (NSXPCCoder.m:1103)
7   Foundation                        0x00000001847cee5c _NSXPCSerializationDecodeTypedObjCValuesFromArray + 936 (NSXPCCoder_InvocationSerialization.m:396)
8   Foundation                        0x00000001848060cc _NSXPCSerializationDecodeInvocationArgumentArray + 500 (NSXPCCoder_InvocationSerialization.m:523)
9   Foundation                        0x00000001847bf514 -[NSXPCDecoder __decodeXPCObject:allowingSimpleMessageSend:outInvocation:outArguments:outArgumentsMaxCount:outMethodSignature:outSelector:isReply:replySelector:interface:] + 788 (NSXPCCoder.m:1236)
10  Foundation                        0x0000000184876b40 -[NSXPCDecoder _decodeReplyFromXPCObject:forSelector:interface:] + 84 (NSXPCCoder.m:1130)
11  Foundation                        0x00000001847f76ac -[NSXPCConnection _decodeAndInvokeReplyBlockWithEvent:sequence:replyInfo:] + 176 (NSXPCConnection.m:259)
12  Foundation                        0x00000001847d24b4 __88-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]_block_invoke_3 + 212 (NSXPCConnection.m:1630)
13  Foundation                        0x00000001847e6a60 -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 2632 (NSXPCConnection.m:1651)
14  Foundation                        0x00000001847f9db4 -[NSXPCConnection _sendSelector:withProxy:arg1:] + 132 (NSXPCConnection.m:1280)
15  Foundation                        0x00000001847cbe5c _NSXPCDistantObjectSimpleMessageSend1 + 68 (NSXPCDistantObject.m:262)
16  CoreServices                      0x00000001833dd388 +[LSBundleProxy bundleProxyForCurrentProcess] + 440 (LSBundleProxy.m:331)
17  Foundation                        0x00000001848b4294 -[NSBundle appStoreReceiptURL] + 108 (NSBundle.m:986)
18  UnityFramework                    0x0000000109ea6fec +[GULAppEnvironmentUtil isAppStoreReceiptSandbox] + 196 (GULAppEnvironmentUtil.m:192)
19  UnityFramework                    0x0000000109ea6cf4 +[GULAppEnvironmentUtil isFromAppStore] + 5713140 (GULAppEnvironmentUtil.m:165)
20  UnityFramework                    0x0000000109ea9614 GULSetLoggerLevel + 5723668 (GULLogger.m:102)
21  UnityFramework                    0x000000010ae9261c firebase::LogSetPlatformLevel+ 22406684 (firebase::LogLevel) + 72
22  UnityFramework                    0x000000010ae92598 firebase::LogInitialize() + 164
23  UnityFramework                    0x000000010ae91e30 firebase::LogMessageWithCallbackV(firebase::LogLevel, char const*, char*) + 80
24  UnityFramework                    0x000000010ae91f48 firebase::LogInfo(char const*, ...) + 36
25  UnityFramework                    0x000000010ae57490 +[UIApplication(FIRFCM) load] + 20
26  libobjc.A.dylib                   0x000000019b5247d0 load_images + 1356 (objc-loadmethod.mm:251)
27  dyld                              0x00000001003c9ee4 dyld4::RuntimeState::notifyObjCInit(dyld4::Loader const*) + 164 (DyldRuntimeState.cpp:1558)
28  dyld                              0x00000001003ce3b8 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 196 (Loader.cpp:1301)
29  dyld                              0x00000001003d4570 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 124 (Loader.cpp:1314)
30  dyld                              0x00000001003cdb54 dyld4::APIs::dlopen_from(char const*, int, void*) + 512 (DyldAPIs.cpp:1435)
31  CoreFoundation                    0x00000001830b209c _CFBundleDlfcnLoadFramework + 140 (CFBundle_Binary.c:610)
32  CoreFoundation                    0x000000018303f058 _CFBundleLoadExecutableAndReturnError + 412 (CFBundle.c:1445)
33  Foundation                        0x0000000184820978 -[NSBundle loadAndReturnError:] + 428 (NSBundle.m:588)
34  My_app                           0x0000000100387d54 UnityFrameworkLoad() + 188 (main.mm:10)
35  My_app                           0x0000000100387dfc main + 36 (main.mm:25)
36  dyld                              0x00000001003dda24 start + 520 (dyldMain.cpp:876)

Thread 1 name:
Thread 1:
0   libsystem_kernel.dylib            0x00000001b9a5b204 __ulock_wait + 8
1   libsystem_platform.dylib          0x00000001f34449a4 _os_unfair_lock_lock_slow + 196 (lock.c:578)
2   dyld                              0x00000001003cda40 dyld4::APIs::dlopen_from(char const*, int, void*) + 236 (DyldAPIs.cpp:96)
3   Foundation                        0x00000001848c0354 ___NSCoderEnforceFirstPartySecurityRules_block_invoke + 56 (NSCoder.m:607)
4   libdispatch.dylib                 0x0000000182c82950 _dispatch_client_callout + 20 (object.m:560)
5   libdispatch.dylib                 0x0000000182c841d8 _dispatch_once_callout + 32 (once.c:52)
6   Foundation                        0x00000001848c08f0 -[NSCoder _walkAllowedClassListLookingForClass:forKey:allowedClasses:strictModeEnabled:alwaysEnforceExplicitSubclasses:] + 1068 (once.h:84)
7   Foundation                        0x00000001847dfabc -[NSXPCDecoder _validateAllowedClass:forKey:allowingInvocations:] + 188 (NSXPCCoder.m:744)
8   Foundation                        0x00000001849f1f28 _decodeObject + 1364 (NSXPCCoder.m:1018)
9   Foundation                        0x00000001847ca6b4 -[NSXPCDecoder _decodeObjectOfClasses:atObject:] + 148 (NSXPCCoder.m:1103)
10  Foundation                        0x00000001847cee5c _NSXPCSerializationDecodeTypedObjCValuesFromArray + 936 (NSXPCCoder_InvocationSerialization.m:396)
11  Foundation                        0x00000001848060cc _NSXPCSerializationDecodeInvocationArgumentArray + 500 (NSXPCCoder_InvocationSerialization.m:523)
12  Foundation                        0x00000001847bf514 -[NSXPCDecoder __decodeXPCObject:allowingSimpleMessageSend:outInvocation:outArguments:outArgumentsMaxCount:outMethodSignature:outSelector:isReply:replySelector:interface:] + 788 (NSXPCCoder.m:1236)
13  Foundation                        0x0000000184876b40 -[NSXPCDecoder _decodeReplyFromXPCObject:forSelector:interface:] + 84 (NSXPCCoder.m:1130)
14  Foundation                        0x00000001847f76ac -[NSXPCConnection _decodeAndInvokeReplyBlockWithEvent:sequence:replyInfo:] + 176 (NSXPCConnection.m:259)
15  Foundation                        0x00000001847d24b4 __88-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]_block_invoke_3 + 212 (NSXPCConnection.m:1630)
16  libxpc.dylib                      0x00000001f348332c _xpc_connection_reply_callout + 116 (serializer.c:119)
17  libxpc.dylib                      0x00000001f347685c _xpc_connection_call_reply_async + 88 (connection.c:833)
18  libdispatch.dylib                 0x0000000182c829d0 _dispatch_client_callout3 + 20 (object.m:586)
19  libdispatch.dylib                 0x0000000182c9ffd4 _dispatch_mach_msg_async_reply_invoke + 348 (mach.c:2464)
20  libdispatch.dylib                 0x0000000182c89f84 _dispatch_lane_serial_drain + 368 (inline_internal.h:0)
21  libdispatch.dylib                 0x0000000182c8ac44 _dispatch_lane_invoke + 444 (queue.c:3937)
22  libdispatch.dylib                 0x0000000182c95318 _dispatch_workloop_worker_thread + 656 (queue.c:6732)
23  libsystem_pthread.dylib           0x00000001f344d1b0 _pthread_wqthread + 288 (pthread.c:2495)
24  libsystem_pthread.dylib           0x00000001f344cf50 start_wqthread + 8

Thread 2 name:
Thread 2:
0   libsystem_kernel.dylib            0x00000001b9a5b204 __ulock_wait + 8
1   libsystem_platform.dylib          0x00000001f34449a4 _os_unfair_lock_lock_slow + 196 (lock.c:578)
2   dyld                              0x00000001003cda40 dyld4::APIs::dlopen_from(char const*, int, void*) + 236 (DyldAPIs.cpp:96)
3   libnetwork.dylib                  0x0000000183d6addc __nw_get_boringssl_image_block_invoke + 64 (tls_context.c:26)
4   libdispatch.dylib                 0x0000000182c82950 _dispatch_client_callout + 20 (object.m:560)
5   libdispatch.dylib                 0x0000000182c841d8 _dispatch_once_callout + 32 (once.c:52)
6   libnetwork.dylib                  0x0000000183d3f3fc __nw_protocol_copy_boringssl_definition_block_invoke + 388 (once.h:84)
7   libdispatch.dylib                 0x0000000182c82950 _dispatch_client_callout + 20 (object.m:560)
8   libdispatch.dylib                 0x0000000182c841d8 _dispatch_once_callout + 32 (once.c:52)
9   libnetwork.dylib                  0x0000000183ceb4cc nw_parameters_copy_description_internal + 14148 (once.h:84)
10  libnetwork.dylib                  0x0000000183d21d10 -[NWConcrete_nw_parameters description] + 20 (parameters.m:2394)
11  Foundation                        0x00000001847bcabc _NS_os_log_callback + 228 (NSPlatform.m:175)
12  libsystem_trace.dylib             0x000000019d6165d0 _os_log_fmt_flatten_NSCF + 64 (format.m:54)
13  libsystem_trace.dylib             0x000000019d615cf0 _os_log_fmt_flatten_object + 216 (format.m:316)
14  libsystem_trace.dylib             0x000000019d613b14 _os_log_impl_flatten_and_send + 1920 (format.c:834)
15  libnetwork.dylib                  0x0000000183d1386c nw_path_evaluator_start + 3180 (path_evaluation.m:3322)
16  libnetwork.dylib                  0x0000000183d478bc nw_path_evaluator_set_update_handler + 220 (path_evaluation.m:3343)
17  SystemConfiguration               0x00000001835fac5c __SCNetworkReachabilitySetDispatchQueue + 1060 (SCNetworkReachability.c:1937)
18  SystemConfiguration               0x00000001835f7e7c SCNetworkReachabilitySetDispatchQueue + 132 (SCNetworkReachability.c:2033)
19  UnityFramework                    0x0000000109ea0e84 -[GDTCORReachability init] + 144 (GDTCORReachability.m:86)
20  UnityFramework                    0x0000000109ea0c90 __36+[GDTCORReachability sharedInstance]_block_invoke + 32 (GDTCORReachability.m:53)
21  libdispatch.dylib                 0x0000000182c82950 _dispatch_client_callout + 20 (object.m:560)
22  libdispatch.dylib                 0x0000000182c841d8 _dispatch_once_callout + 32 (once.c:52)
23  UnityFramework                    0x0000000109ea0c6c +[GDTCORReachability sharedInstance] + 5688428 (GDTCORReachability.m:52)
24  UnityFramework                    0x0000000109ea0c24 +[GDTCORReachability initialize] + 20 (GDTCORReachability.m:46)
25  libobjc.A.dylib                   0x000000019b528764 CALLING_SOME_+initialize_METHOD + 24 (objc-initialize.mm:384)
26  libobjc.A.dylib                   0x000000019b51e3ac initializeNonMetaClass + 784 (objc-initialize.mm:554)
27  libobjc.A.dylib                   0x000000019b5225a8 initializeAndMaybeRelock(objc_class*, objc_object*, mutex_tt<false>&, bool) + 156 (objc-runtime-new.mm:2178)
28  libobjc.A.dylib                   0x000000019b51b6a0 lookUpImpOrForward + 884 (objc-runtime-new.mm:2194)
29  libobjc.A.dylib                   0x000000019b516a84 _objc_msgSend_uncached + 68
30  UnityFramework                    0x0000000109ea3904 -[GDTCORUploadCoordinator uploadConditions] + 32 (GDTCORUploadCoordinator.m:143)
31  UnityFramework                    0x0000000109ea339c __37-[GDTCORUploadCoordinator startTimer]_block_invoke_2 + 128 (GDTCORUploadCoordinator.m:80)
32  libdispatch.dylib                 0x0000000182c82950 _dispatch_client_callout + 20 (object.m:560)
33  libdispatch.dylib                 0x0000000182c85e04 _dispatch_continuation_pop + 504 (inline_internal.h:2597)
34  libdispatch.dylib                 0x0000000182c98d60 _dispatch_source_invoke + 1356 (source.c:587)
35  libdispatch.dylib                 0x0000000182c89f84 _dispatch_lane_serial_drain + 368 (inline_internal.h:0)
36  libdispatch.dylib                 0x0000000182c8ac10 _dispatch_lane_invoke + 392 (queue.c:3937)
37  libdispatch.dylib                 0x0000000182c95318 _dispatch_workloop_worker_thread + 656 (queue.c:6732)
38  libsystem_pthread.dylib           0x00000001f344d1b0 _pthread_wqthread + 288 (pthread.c:2495)
39  libsystem_pthread.dylib           0x00000001f344cf50 start_wqthread + 8

Thread 3:
0   libsystem_pthread.dylib           0x00000001f344cf48 start_wqthread + 0


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0xfffffffffffffffc   x1: 0x0000000000000000   x2: 0x0000000000001609   x3: 0x0000000000000000
    x4: 0x00000002837a0bc0   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000d30
    x8: 0x000000000000170b   x9: 0x0000000000001608  x10: 0x0000000000000001  x11: 0x0000000000000000
   x12: 0x00000000000000ba  x13: 0x00000000000000bb  x14: 0x3e78328c6fc2d844  x15: 0x0000000184a30f94
   x16: 0x0000000000000203  x17: 0x00000001848c031c  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x00000001dcc55e10  x21: 0x0000000001000002  x22: 0x0000000000001609  x23: 0x0000000000000000
   x24: 0x00000001cd502cc8  x25: 0x0000000000000000  x26: 0x00000001cd5d2dc8  x27: 0x00000001dc3d46a0
   x28: 0x00000001dcc57188   fp: 0x000000016fa7c5e0   lr: 0x0000000182c83344
    sp: 0x000000016fa7c5c0   pc: 0x00000001b9a5b204        cpsr: 0x0
   esr: 0x56000080  Address size fault


Binary Images:
0x100380000 - 0x100387fff My_app arm64  <8d098aee3b5635ac8ac58bdb9f8555c2> /private/var/containers/Bundle/Application/90A535F8-D72B-4DDE-92CD-E21BB5A700BA/My_app.app/My_app
0x1003c4000 - 0x10041bfff dyld arm64e  <d48c31ee061f370ba6f78391a1b53ed8> /usr/lib/dyld
0x109934000 - 0x10d163fff UnityFramework arm64  <a677204d54bf3f879bb96f9cf79232ce> /private/var/containers/Bundle/Application/90A535F8-D72B-4DDE-92CD-E21BB5A700BA/My_app.app/Frameworks/UnityFramework.framework/UnityFramework
0x182c7f000 - 0x182cc4fff libdispatch.dylib arm64e  <959cd6e40ce73022b73c8b36f79f4745> /usr/lib/system/libdispatch.dylib
0x182f77000 - 0x1833cafff CoreFoundation arm64e  <6174789ae88c3f5cba39de2e9edc0750> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x1833cb000 - 0x1835a7fff CoreServices arm64e  <8d3ff6abc6ed39a78c72f68dc150901f> /System/Library/Frameworks/CoreServices.framework/CoreServices
0x1835f1000 - 0x18366afff SystemConfiguration arm64e  <c250509f5dfa3961a5b079af86531c92> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
0x183c52000 - 0x184722fff libnetwork.dylib arm64e  <d810c68913393fc696e8196b9901e4dc> /usr/lib/libnetwork.dylib
0x1847a1000 - 0x184aa5fff Foundation arm64e  <efbca2ff8b8c3227abbc154ba851d23c> /System/Library/Frameworks/Foundation.framework/Foundation
0x19b515000 - 0x19b54efff libobjc.A.dylib arm64e  <6d12ade560653900a6bc80677ccac819> /usr/lib/libobjc.A.dylib
0x19d610000 - 0x19d628fff libsystem_trace.dylib arm64e  <e47c51bb9d5a3882a6bef744a30cce80> /usr/lib/system/libsystem_trace.dylib
0x1b9a59000 - 0x1b9a8cfff libsystem_kernel.dylib arm64e  <d2476f74d204348d8d386165d0485c7c> /usr/lib/system/libsystem_kernel.dylib
0x1f3444000 - 0x1f344afff libsystem_platform.dylib arm64e  <9b829bd8a5ba3cd78e9313538dcd12b2> /usr/lib/system/libsystem_platform.dylib
0x1f344c000 - 0x1f3457fff libsystem_pthread.dylib arm64e  <bc1ce0c6a9f2396b9afb623d3acd5881> /usr/lib/system/libsystem_pthread.dylib
0x1f3467000 - 0x1f349efff libxpc.dylib arm64e  <e8a600510c6835aeaefd9d97cc7f2696> /usr/lib/system/libxpc.dylib

EOF

1 Like

Workaround in case you are using Firebase.
Add to Info.plist record (via Xcode, Boolean type):
FirebaseAppStoreReceiptURLCheckEnabled = NO

7 Likes

I have same trouble
My enviroment is Unity 2021.1.24f1 and xcode 13.0
please help

Thank you! This solved it for us. We also had this problem, starts up on first try but crashes beyond 2nd try. Worked on iPad iOS 14.7.1 concurrently. I still get some wierd logs in Xcode when running:

<strong>[general] *** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSString' (__***********__) [/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set: '{(</strong>

__"'NSArray' (***********) [/System/Library/Frameworks/CoreFoundation.framework]"__

**)}'. This will be disallowed in the future.**

Hi, we had FirebaseAppStoreReceiptURLCheckEnabled = NO to Info.plist but it didn’t work. Anyone with a possible solution?

Downgrading to xcode 12.5 fixed this

2 Likes

It looks like you have some key on Info.plist with incorrect type. Do you have record with key “NS.objects”? Looks like there used NSString somewhere where should be used NSArray.
Just an idea.
By the way, FirebaseAppStoreReceiptURLCheckEnabled should have type Boolean.

We have the same issue. The game stucks since 2nd session on ios 15.

We added FirebaseAppStoreReceiptURLCheckEnabled = 0 (Boolean) to info.plist. However, it didn’t work.

Is there any solution? (We are going to downgrade xcode to 12.5)

Our environment is:

  • Unity: 2019.4.17
  • Xcode: 13.0
  • Firebase: 8.2

Adding FirebaseAppStoreReceiptURLCheckEnabled = 0 (Boolean) to info.plist works fine.

We had another issue in our project. We upgraded MoPub to 5.18 this time, and the crash was caused by the ironSrouce sdk. Unfortunately, the behavior was the same to the firebase crash. It cost us a long time to debug.

Issue: The game stucks since 2nd session on ios 15.
Environment:

  • Unity: 2019.4.17
  • Xcode: 13.0 (also crashed in 12.5)
  • MoPub: 5.18
  • ironSource:1.2.23(ios:7.1.11.0)
    Current Solution: Remove ironSource SDK;
2 Likes

Finaly i found the solution. Downgrade xcode to 12.5
Environment:
Unity:2020.3.20f1
XCode: Before:13.0 After: 12.5

Not the best solution to downgrade especially if you have an “Invalid bitcode version” error because of the installed SDK. So will wait for a proper fix.

FirebaseAppStoreReceiptURLCheckEnabled = 0 (Boolean) solved my problem.
Thanks a lot.

It seems that it’s an issue related to the inner workings between iOS 15 and Firebase. What I found the most terrifying is that we wouldn’t know this issue will be coming until iOS 15 is released. By the time when we discover the issue, many users have been experienced this issue and quit the game for good.

Seems like it’s fixed in Firebase 8.8.0

1 Like

Any updates on this issue? updating firebase to 8.8.0 didn’t work for us

Firebase 8.8.0 didn’t fix the issue.

Adding FirebaseAppStoreReceiptURLCheckEnabled = NO would cause another issue. The firebase analytics will not log in_app_purchasing event.

1 Like

if you have mobile notifications package, update it to 2.0.0+

1 Like