Search Unity

Advertisement.cs causes error in XCode on runtime

Discussion in 'Unity Ads & User Acquisition' started by 5argon, Jul 28, 2015.

  1. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555


    The program stopped outright after running. (I wonder why you guys can use Unity Ads normally)
    So the isDebugBuild here is apparently the static field of Advertisement.cs.



    XCode tells you you should not do Debug.isDebugBuild from thread other than main thread. But if it is here it will being called before entering main thread... I got the Ads script from official page. Did I do something wrong?

    Also error in UnityAds.cs in
    private static string _versionString = Application.unityVersion + "_" + Advertisement.version;

    For the same reason that static field are calling into something out of main thread. (unityVersion)
     
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Hi,

    We haven't seen this issue earlier. Can you post code to reproduce the issue plus information about Unity and Xcode versions? Alternatively use Help->Report a bug menu to create a bug report on this (and post the ticket # here)

    Thanks,
    Rasmus
     
  3. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    I will reproduce it later, for now my workaround is moving the static initializer code to the Start or Awake as it says. (Only 2 locations I mentioned is neccessary to let the game run.)