Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity3D Game Crashes in Xcode 9 - iOS 11

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)'

enter image description here

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. enter image description here

like image 227
Guru Avatar asked Sep 20 '17 13:09

Guru


People also ask

Do Unity games work on iOS?

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.

Can I use Xcode with Unity?

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.

How do I find out why Unity crashes?

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.


1 Answers

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.

enter image description here

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.

like image 155
Programmer Avatar answered Sep 20 '22 03:09

Programmer