juicycleff / flutter-unity-view-widget

Embeddable unity game engine view for Flutter. Advance demo here https://github.com/juicycleff/flutter-unity-arkit-demo
BSD 3-Clause "New" or "Revised" License
2.14k stars 523 forks source link

App crashes on iOS16 with Xcode 14 #703

Closed timbotimbo closed 1 year ago

timbotimbo commented 1 year ago

[Update: this was fixed in newer Unity versions, see the comments below]

Describe the bug Unity will instantly crash when ran on an iOS 16 device using Xcode 14. This will cause an app using flutter_unity_widget to crash on the splash screen. The exact same project will run like normal with Xcode 14 on iPadOS 15, and probably iOS 15 too.

Looks like the issue was already reported to Flutter here by @RoyalCoder88, but it was closed because it is a Unity issue. Given that we use Unity here, it is important to document this crash here.

I'm not sure which exact Unity versions have this error, but I've seen multiple 2021.3.x versions mentioned.

To Reproduce My setup:

  1. Setup the example project, and export iOS in the Unity project.
  2. Click run in Xcode.
  3. Xcode will throw errors when the app starts.

Solution This unity forum thread has a workaround.

In Xcode go to Product > Scheme > Edit Scheme > Run > Diagnostics (shortcut ⌘ <). Now disable Thread Performance Checker. scheme

Changing this setting has stopped the crash for me.

Related For another iOS 16 crash, this other Unity forum thread mentions random crashes in AR on iOS 16. Here disabling Multi-threaded rendering in the Unity player settings seems to get rid of the crashes.

Error messages Some text visible in Xcode for Future search engine hits:

~AutoLock [inlined]
Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1115cccb0)

warning: UnityFramework was compiled with optimization - stepping may behave oddly; variables may not be available.
(lldb) 
timbotimbo commented 1 year ago

Looks like this Is also a duplicate of #693.

alicanyimaz commented 1 year ago

Helal lan sana

timbotimbo commented 1 year ago

This was fixed by Unity.

Fix is available since: 2021.3.17f1 2022.2.2f1 2023.1.0a20