SpaceMadness / lunar-unity-console

High-performance Unity iOS/Android logger built with native platform UI
https://www.assetstore.unity3d.com/en/#!/content/43800
Other
833 stars 112 forks source link

App fails to launch on iOS 14.2 beta #183

Closed Nezz closed 3 years ago

Nezz commented 3 years ago

We encountered an issue with our app when running on the iOS 14.2 beta: the app fails to launch with Lunar Console 1.8.0 enabled. The crash report isn't really useful, it just shows that the app is stuck while loading. Disabling Lunar Console resolves the issue.

OS Version:          iPhone OS 14.2 (18B5072f)
Release Type:        Beta
Baseband Version:    2.02.03
Report Version:      104

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Termination Description: SPRINGBOARD, <RBSTerminateContext| domain:10 code:0x8BADF00D explanation:process-launch watchdog transgression: application<com.yousician.yousician>:879 exhausted real (wall clock) time allowance of 20.00 seconds | ProcessVisibility: Foreground | ProcessState: Running | WatchdogEvent: process-launch | WatchdogVisibility: Foreground | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 16.140 (user 16.140, system 0.000), 13% CPU", | "Elapsed application CPU time (seconds): 0.109, 0% CPU" | ) reportType:CrashLog maxTerminationResistance:Interactive>
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x00000001d6586f5c __ulock_wait + 8
1   libdispatch.dylib               0x00000001a8ce9794 _dlock_wait + 56
2   libdispatch.dylib               0x00000001a8ce96c0 _dispatch_once_wait + 124
3   UIKitCore                       0x00000001ab6a2c40 -[_UIApplicationConfigurationLoader _loadInitializationContext] + 152
4   UIKitCore                       0x00000001ab6a2f8c -[_UIApplicationConfigurationLoader applicationInitializationContext] + 32
5   UIKitCore                       0x00000001ab689ba4 -[_UIScreenInitialDisplayConfigurationLoader initialDisplayContext] + 180
6   UIKitCore                       0x00000001ab689e90 +[UIScreen initialize] + 128
7   libobjc.A.dylib                 0x00000001bdbbbc58 CALLING_SOME_+initialize_METHOD + 24
8   libobjc.A.dylib                 0x00000001bdbc2318 initializeNonMetaClass + 716
9   libobjc.A.dylib                 0x00000001bdbc3910 initializeAndMaybeRelock+ 39184 (objc_class*, objc_object*, mutex_tt<false>&, bool) + 280
10  libobjc.A.dylib                 0x00000001bdbd2498 lookUpImpOrForward + 956
11  libobjc.A.dylib                 0x00000001bdbbc524 _objc_msgSend_uncached + 68
12  UIKitCore                       0x00000001ab6a3490 _UIGetCurrentFallbackTraitCollection + 100
13  UIKitCore                       0x00000001ab6a01e8 +[UITraitCollection _currentTraitCollectionWithFallback:markFallback:] + 176
14  UIKitCore                       0x00000001ab6a7c64 _UICurrentImageTraitCollection + 28
15  UIKitCore                       0x00000001ab6a7904 +[UIImageConfiguration _completeConfiguration:fromConfiguration:] + 164
16  UIKitCore                       0x00000001ab6562e0 +[UIImage imageNamed:inBundle:withConfiguration:] + 180
17  UnityFramework                  0x0000000102ad1e2c 0x102788000 + 3448364
18  libobjc.A.dylib                 0x00000001bdbbbc58 CALLING_SOME_+initialize_METHOD + 24
19  libobjc.A.dylib                 0x00000001bdbc2318 initializeNonMetaClass + 716
20  libobjc.A.dylib                 0x00000001bdbc3910 initializeAndMaybeRelock+ 39184 (objc_class*, objc_object*, mutex_tt<false>&, bool) + 280
21  libobjc.A.dylib                 0x00000001bdbd2498 lookUpImpOrForward + 956
22  libobjc.A.dylib                 0x00000001bdbbc524 _objc_msgSend_uncached + 68
23  UnityFramework                  0x0000000102abfd6c 0x102788000 + 3374444
24  libobjc.A.dylib                 0x00000001bdbcb21c load_images + 928
25  libdyld.dylib                   0x00000001a8d39840 invocation function for block in dyld3::AllImages::runInitialzersBottomUp+ 71744 (dyld3::closure::Image const*) + 224
26  libdyld.dylib                   0x00000001a8d2b18c dyld3::closure::Image::forEachImageToInitBefore(void + 12684 (unsigned int, bool&) block_pointer) const + 104
27  libdyld.dylib                   0x00000001a8d3a344 dyld3::AllImages::loadImage+ 74564 (Diagnostics&, char const*, unsigned int, dyld3::closure::DlopenClosure const*, bool, bool, bool, bool, void const*) + 828
28  libdyld.dylib                   0x00000001a8d39e2c dyld3::AllImages::dlopen+ 73260 (Diagnostics&, char const*, bool, bool, bool, bool, bool, void const*, bool) + 904
29  libdyld.dylib                   0x00000001a8d3bd14 dyld3::dlopen_internal+ 81172 (char const*, int, void*) + 372
30  libdyld.dylib                   0x00000001a8d2dd44 dlopen_internal+ 23876 (char const*, int, void*) + 112
31  CoreFoundation                  0x00000001a904a180 _CFBundleDlfcnLoadFramework + 140
32  CoreFoundation                  0x00000001a9019f4c _CFBundleLoadExecutableAndReturnError + 384
33  Foundation                      0x00000001aa348908 -[NSBundle loadAndReturnError:] + 336
weeeBox commented 3 years ago

@Nezz, what device and Xcode version do you use?

Nezz commented 3 years ago

@weeeBox Xcode 12.1 and iPhone X, iPhone 11

MarkLaprairie commented 3 years ago

I had the same issue, but with Lunar and iOS 14.2.
I tried Xcode 12.1 and 12.2 (RC).
Disabling Lunar console fixes the crash in Test Flight. It works when you run the app directly from xcode (12.2 RC) to a device (iOS 14.2), but not through Test Flight.
Tested on an iPhone XS.

weeeBox commented 3 years ago

@Nezz, @MarkLaprairie, I can't reproduce this on my own. Would you be able to check if the issue persists in an empty app with just LunarConsole in it?

p.s. what other plugins do you use?

weeeBox commented 3 years ago

Also, what Unity version do you use?

MarkLaprairie commented 3 years ago

Hello Alex,

Thanks for replying- and thanks for the absolutely amazing tool!

This issue currently occurs on two of my titles using Lunar and Unity 2019.4.X (14f and something older) when launching through test flight. One is forward rendered, one is deferred.

The forward rendered 2019.4.14f title has mostly standard packages included: ARFoundation, AR Subsystems, ARCore XR Plugin, ARKit Face Tracking, ARKit XR Plugin, Cinemachine, Device Simulator, JetBrains Rider Editor, Post Processing, Pro builder, ProGrids, TextMeshPro.

Both titles that I have seen the issue on do include the AR packages, but don't initialize the camera on startup (it's just a mode in the game). Both have the Post Processing package and ProBuilder.

I'll let you know if I get any more information, or am able to test an empty project.

On Mon, Nov 9, 2020 at 8:58 AM Alex Lementuev notifications@github.com wrote:

Also, what Unity version do you use?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SpaceMadness/lunar-unity-console/issues/183#issuecomment-724141760, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYW7HRZ5LC5E4RCBKBMWCDSPANVDANCNFSM4TE7UMEQ .

robinfischerinnogames commented 3 years ago

We have the same issue. Two of our Apps do not start on iOS 14.2 when LunarConsole is included in the build. When running with Xcode 12.2 beta 4 it works. But starting that same app without having the Xcode debugger attached triggers the problem.

The App starts and we see the default grey iOS Storyboard Splash screen that appears before the Unity SplashScreen takes over. The app just hangs in that grey state until iOS quits/crashes the app because it became stale.

Unity 2019.4.9f1 Our Crashlog:

Hardware Model:      iPad6,11
Process:             myGame [768]
Path:                /private/var/containers/Bundle/Application/7390F09B-7E5D-4F3A-9B0D-B6AB396833D5/myGame.app/myGame
Identifier:          com.myCompany.myGame25
Version:             0 (0.14.0)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.myCompany.myGame25 [729]

Date/Time:           2020-11-10 11:28:35.6008 +0100
Launch Time:         2020-11-10 11:28:15.4966 +0100
OS Version:          iPhone OS 14.2 (18B92)
Release Type:        User
Baseband Version:    n/a
Report Version:      104

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Termination Description: SPRINGBOARD, <RBSTerminateContext| domain:10 code:0x8BADF00D explanation:process-launch watchdog transgression: application<com.myCompany.myGame25>:768 exhausted real (wall clock) time allowance of 20.00 seconds | ProcessVisibility: Foreground | ProcessState: Running | WatchdogEvent: process-launch | WatchdogVisibility: Foreground | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 2.390 (user 2.390, system 0.000), 6% CPU", | "Elapsed application CPU time (seconds): 0.149, 0% CPU" | ) reportType:CrashLog maxTerminationResistance:Interactive>
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x00000001ddf56290 __ulock_wait + 8
1   libdispatch.dylib               0x00000001b318f5a4 _dlock_wait + 52
2   libdispatch.dylib               0x00000001b318f4e4 _dispatch_once_wait$VARIANT$mp + 112
3   UIKitCore                       0x00000001b5a4f120 -[_UIApplicationConfigurationLoader _loadInitializationContext] + 120
4   UIKitCore                       0x00000001b5a4f3ec -[_UIApplicationConfigurationLoader applicationInitializationContext] + 28
5   UIKitCore                       0x00000001b5a37b24 -[_UIScreenInitialDisplayConfigurationLoader initialDisplayContext] + 176
6   UIKitCore                       0x00000001b5a37e00 +[UIScreen initialize] + 124
7   libobjc.A.dylib                 0x00000001c6f60064 CALLING_SOME_+initialize_METHOD + 20
8   libobjc.A.dylib                 0x00000001c6f660b0 initializeNonMetaClass + 712
9   libobjc.A.dylib                 0x00000001c6f67410 initializeAndMaybeRelock+ 37904 (objc_class*, objc_object*, mutex_tt<false>&, bool) + 300
10  libobjc.A.dylib                 0x00000001c6f7552c lookUpImpOrForward + 856
11  libobjc.A.dylib                 0x00000001c6f60820 _objc_msgSend_uncached + 64
12  UIKitCore                       0x00000001b5a4f8e0 _UIGetCurrentFallbackTraitCollection + 96
13  UIKitCore                       0x00000001b5a4c940 +[UITraitCollection _currentTraitCollectionWithFallback:markFallback:] + 172
14  UIKitCore                       0x00000001b5a53ce8 _UICurrentImageTraitCollection + 24
15  UIKitCore                       0x00000001b5a539b0 +[UIImageConfiguration _completeConfiguration:fromConfiguration:] + 160
16  UIKitCore                       0x00000001b5a06d54 +[UIImage imageNamed:inBundle:withConfiguration:] + 176
17  UnityFramework                  0x00000001039d1620 0x103800000 + 1906208
18  libobjc.A.dylib                 0x00000001c6f60064 CALLING_SOME_+initialize_METHOD + 20
19  libobjc.A.dylib                 0x00000001c6f660b0 initializeNonMetaClass + 712
20  libobjc.A.dylib                 0x00000001c6f67410 initializeAndMaybeRelock+ 37904 (objc_class*, objc_object*, mutex_tt<false>&, bool) + 300
21  libobjc.A.dylib                 0x00000001c6f7552c lookUpImpOrForward + 856
22  libobjc.A.dylib                 0x00000001c6f60820 _objc_msgSend_uncached + 64
23  UnityFramework                  0x00000001039bf560 0x103800000 + 1832288
24  libobjc.A.dylib                 0x00000001c6f6e25c load_images + 944
25  libdyld.dylib                   0x00000001b321a114 invocation function for block in dyld3::AllImages::runInitialzersBottomUp+ 65812 (dyld3::closure::Image const*) + 220
26  libdyld.dylib                   0x00000001b320ce6c dyld3::closure::Image::forEachImageToInitBefore(void + 11884 (unsigned int, bool&) block_pointer) const + 92
27  libdyld.dylib                   0x00000001b321ab48 dyld3::AllImages::loadImage+ 68424 (Diagnostics&, char const*, unsigned int, dyld3::closure::DlopenClosure const*, bool, bool, bool, bool, void const*) + 776
28  libdyld.dylib                   0x00000001b321a698 dyld3::AllImages::dlopen+ 67224 (Diagnostics&, char const*, bool, bool, bool, bool, bool, void const*, bool) + 872
29  libdyld.dylib                   0x00000001b321c2b4 dyld3::dlopen_internal+ 74420 (char const*, int, void*) + 368
30  libdyld.dylib                   0x00000001b320f5b0 dlopen_internal+ 21936 (char const*, int, void*) + 108
31  CoreFoundation                  0x00000001b350f038 _CFBundleDlfcnLoadFramework + 136
32  CoreFoundation                  0x00000001b34e0974 _CFBundleLoadExecutableAndReturnError + 376
33  Foundation                      0x00000001b477bba8 -[NSBundle loadAndReturnError:] + 332
34  myGame                          0x000000010203fd54 UnityFrameworkLoad() + 32084 (main.mm:12)
35  myGame                          0x000000010203fdfc main + 32252 (main.mm:0)
36  libdyld.dylib                   0x00000001b320b588 start + 4
fknr commented 3 years ago

We have the same issue on iOS 14.2 on an iPhone SE 2 Built with Unity 2019.4.14f1 and XCode 12.1

weeeBox commented 3 years ago

@Nezz, @fknr, @MarkLaprairie, @robinfischerinnogames, I was able to reproduce the issue. Figuring out what's wrong...

weeeBox commented 3 years ago

Most likely we're dealing with this: https://issuetracker.unity3d.com/issues/ios-unityframework-with-3rd-party-plugins-triggers-watchdog-termination-after-launch?_ga=2.73801047.413637617.1601901013-225196644.1542053313

The proposed workaround didn't work on my setup (Unity 2020.1.4f1, Xcode 12.2, iOS 14.2). Replacing load methods with initialize didn't work as well. Continue investigating.

weeeBox commented 3 years ago

@Nezz, @fknr, @MarkLaprairie, @robinfischerinnogames, I've prepared a patch: it still takes around 20 seconds to launch from Xcode but it doesn't crash when you run it without the IDE. Please, let me know if it works for you!

lunar-console-1.8.1-patch.unitypackage.zip

robinfischerinnogames commented 3 years ago

Latest version on the Unity Asset Store (1.8.1) (which I guess is the same as the patch above) fixed the issue! Thank you 👍

fknr commented 3 years ago

I, too can confirm that the fix is working. Thanks a lot for the quick response 👍

weeeBox commented 3 years ago

Fixed in 1.8.1

drmaxandrianov commented 3 years ago

Still facing same problem with Lunar Console 1.8.1 on Unity 2020.2.0f1. Game works if started from Xcode with Run button, but crashes if run from device itself.