Unity Exception StackTrace is missing when upgrading xcode to version 9

  • Unity version: 5.6.1p1
  • Bad Xcode version: 9.0 (9A235)
  • Good Xcode version: 8.3.3 (8E3004b)

I am a game programmer and I use Unity to develop our game. Before I upgrade xcode, everything is fine. Any exception thrown can be caught and logged with detailed stacktrace. It is very useful to me. But after I upgrade xcode to version 9.0, I found all the stacktrace is missed when some exception is thrown. I can only get the type and the message of the exception. It is so wired.

these are the key steps to I use to export ipa from unity:

  • export unity project to a xcode project.
  • xcodebuild archive with some necessary options to archive to file XXX.xcarchive.
  • xcodebuild -exportArchive with some necessary options to get the final ipa.

This is the good exception log(with xcode 8.3.3):
type: System.Reflection.TargetException
msg: Non-static field requires a target
target: AddComp
source: Assembly-CSharp-firstpass
stack:
at Eve.ActorCompMgr.AddComp (Eve.ActorComp comp) [0x00000] in :0
at System.Reflection.MonoField.GetValue (System.Object obj) [0x00000] in :0
at Eve.SimpleJsonSerializer.GetNullStringIndicator (Eve.SimpleJsonConfig cfg) [0x00000] in :0
at Eve.Game.GlobalConfigAFXHelper.RefreshAllGlobalAFXControlParam () [0x00000] in :0
at Eve.Game.LoginEventHandler.m__0 (Eve.Game.KVConfTable resp) [0x00000] in :0
at Eve.Game.KVConfTable+RebuildCb.Invoke (Eve.Game.KVConfTable conf) [0x00000] in :0
at Eve.Game.KVConfTable.Rebuild (Eve.Game.Metadata md) [0x00000] in :0
at Eve.Game.Metadata+RefreshHandler.Invoke (Eve.Game.Metadata md) [0x00000] in :0
at Eve.Game.Metadata.OnRefresh (proto.MetadataInfoResp md) [0x00000] in :0
at Eve.Game.Metadata.Reset (proto.MetadataInfoResp md) [0x00000] in :0
at Eve.Game.LoginEventHandler.ResetMetadata (proto.AuthUserLoginResult msg) [0x00000] in :0
at Eve.Game.LoginEventHandler.OnPostUserLogin (Eve.Event e) [0x00000] in :0
at Eve.EventMgr+EventHandler.Invoke (Eve.Event e) [0x00000] in :0
at Eve.EventMgr.EmitEvent (Eve.Event e) [0x00000] in :0
at Eve.Game.StateUserLogin.responseHandler (Eve.HttpRequest req, Eve.DefaultHttpResponse res) [0x00000] in :0
at Eve.DefaultHttpRouter+MsgHandler.Invoke (Eve.HttpRequest req, Eve.DefaultHttpResponse res) [0x00000] in :0
at Eve.DefaultHttpRouter.HandleMsg (Eve.HttpRequest req, Eve.HttpResponse res) [0x00000] in :0
at Eve.Logger.LogMsg (System.String format, System.Object[ ] args) [0x00000] in :0
at Eve.HttpRouter.Dispatch () [0x00000] in :0
at Eve.HttpMgr.Update () [0x00000] in :0
at Eve.App.Update () [0x00000] in :0
at Main.Update () [0x00000] in :0
detail info:

UnityEngine.Debug:LogException(Exception)
Eve.Logger:Log(LogLevel, String, Object[ ])
Eve.Logger:LogException(Exception, String, Object[ ])
Eve.Logger:LogException(Exception)
Main:Update()

This is the bad one(with xcode 9.0):
type: System.Reflection.TargetException
msg: Non-static field requires a target
target:
source:
stack:

detail info:

It is so wired. Is there anybody know what changes in xcode 9?

Thanks for the information. We do see problems with certain Xcode versions at times. Can you submit a bug report with a project that reproduces this issue? We would love to correct it.