Today I launched fully working Unity3D game in Xcode 9, iPhone 6 running iOS 11. Its crashing on launch.
Every time crashing in same function : SetupMetalFBO
Here is console log:
validateRenderPassDescriptor:487: failed assertion `Texture at colorAttachment[0] has usage (0x01) which doesn't specify MTLTextureUsageRenderTarget (0x04)'
Same code worked perfect with Xcode 8.3.3 iOS 10.
How to fix crash in Xcode 9 ?
UPDATES_SOLUTION :
Solution is simple, just goto Xcode->Product->Scheme->Edit Scheme, disable Metal API Validation. This fix crash.
Building games for iOS. Bring your game to life with Unity, the chosen platform for over 60% of the top-grossing mobile games on the Apple App Store.
Build the Xcode project Build the app by going to File -> Build Settings, selecting iOS and clicking Build. Unity will build the selected scenes and produce an XCode project in the selected folder. Depending on your versions of Unity and Xcode, you may be able to select Build and Run instead.
To view your crash and exception reports, you can open the Unity Developer dashboard from either the Cloud Diagnostics panel in the Unity Editor or you can sign in to the Unity Developer Dashboard.
The MTLTextureUsageRenderTarget
in the error shows that this is a Apple's Metal issue.
Unity 4.6.9 is extremely old to work on iOS 11 and is no longer patched to fix issues on platforms like iOS. You should also worry about your latest app being rejected from the app store due to IPv6 compatibly issues.
You have three options:
1.Disable Metal API Validation in Xcode
2.Use OpenGLES instead of Metal.
First of all, disable Auto Graphics API then change iOS Graphics API to OpenGLES2 or OpenGLES3 in Unity's Player Settings.
3.Update to Unity to the latest version of Unity if #1 and #2 fail. If you update Unity and the problem is still there then you can file for bug report from the Editor. I expect this issue to be gone if you update Unity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With