Search Unity

iOS 10.0 and Xcode 8 compatibility

Discussion in 'iOS and tvOS' started by Mantas-Puida, Sep 8, 2016.

  1. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    App Store submissions
    • in case you have to ship your app within couple of next weeks please keep using Xcode 7.3 for that. At the moment it provides smoother experience.
    • in case you have to use Xcode 8 here couple of advises, which should help you:
      • if your application depends camera (WebCamTexture API) you have to specify reason why this feature is being used in Info.plist located in Xcode project Unity generates. Add there NSCameraUsageDescription key with string value containing the description. (This will be exposed in Player Settings for Unity 5.4.1p1, expected to ship on 14th of September).
      • if your application doesn't use WebCamTexture API you need to disable camera code in Xcode project Unity generates. This is temporary measure until we ship automatic fix next week (~21st of September). Open Classes/Unity/CameraCapture.mm in generated Xcode project, go to the first line and replace "#if !UNITY_TVOS" and with "#if 0". This will effectively remove camera capture code and you should pass automatic submission check.

    Quick summary on other iOS 10.0 and Xcode 8 compatibility aspects
    • latest Unity 5.3 and 5.4 patches (like 5.3.6p4 and 5.4.0p4) should work just fine for development.
    • older Unity versions will mostly work, but some inconveniences might be expected.

    More detailed overview
    • Xcode 8 Build & Run works in 5.3 and 5.4 Unity versions since middle of July. Though there is inconvenience that by default Xcode project doesn't have your team selected and thus it would fail to sign project. Selecting it once and then appending project makes it work. We are working to allow you specify team id in Player Settings. This improvement should land in Sep 14 patches. We aim to make it more automatic in the future.
    • Xcode 8 Simulator builds should work with latest 5.3 and 5.4, but might crash with older Unity versions.
    • iOS 10.0 now requires to specify reason for camera, microphone and location access. We added fields for that in Unity 5.4 and later. (Will ship in patch release on Sep 14). For older Unity versions postprocessing script that updates Info.plist is advised.
    • iPhone 7 and 7+ device enum entries were added. Will ship in Sep 14 patches.
    • target OS version enum was also updated to include latest iOS versions. Will ship in Sep 14 patches.
    • ReplayKit broadcasting API is in the works, will ship bit later. (Unity 5.5 and probably to be included into 5.4 patch too).
    Edits: submission section added, dates updated, reformatted
     
    Last edited: Sep 13, 2016
    DobleU and 00christian00 like this.
  2. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    Great News! When you say ReplayKit is in the works, mean 5.4, 5.5 or even later?
     
  3. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    ReplayKit Recording is already part of 5.4: https://docs.unity3d.com/ScriptReference/Apple.ReplayKit.ReplayKit.html
    ReplayKit Live Broadcasting we will be adding for 5.5, but it's also considered to be backported to 5.4, but decision isn't final yet.
     
    00christian00 likes this.
  4. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Will all this ship in 5.4.1 patch 1? as we got the 5.4.1 release.
    Need to know a date next week so can plan on upgrading App.
    Thank you.
     
  5. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Yes, it will be 5.4.1p1.
     
  6. michaeltepl

    michaeltepl

    Joined:
    Dec 26, 2013
    Posts:
    22
    In Unity 5.4.0 and 5.4.1 deviceToken is not received after calling RegisterForNotifications and there is no registrationError. Please fix this problem cause remote notifications is not working after upgrade from version 5.3.6
     
  7. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    I asked QA to look into your case with priority.
     
  8. ThomHurks

    ThomHurks

    Joined:
    Jul 27, 2010
    Posts:
    22
    Might be good to know for some people: In my experience building for iOS using the 5.5 beta 3 and Xcode 8 does *not* work.
     
  9. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Do you have more details what does not work? We are regularly testing 5.5 beta against Xcode 8 and didn't notice any major issues.
     
  10. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Do you know when the iOS 10 patch be out this week, today or tommorow?

    P.S. I know one this they changed in Xcode that may produce errors: The use of "@" for example in icon names..
     
  11. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    5.3 and 5.4 patches are scheduled for Wednesday.

    Could you please provide more details/examples on issue you mentioned? I'm not sure we noticed anything unusual in this area.
    Thanks!
     
  12. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    I updated original thread post with submission information and expected dates.
     
  13. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    663
    I'm using everyplay. I guess that is why i saw two new entries in the info.plist, and why a friend of mine had a pop up saying that the Everyplay SDK is expired on his iOS 10 device. (I compiled it with the older SDK than the current one.)
     
  14. adamt

    adamt

    Joined:
    Apr 1, 2014
    Posts:
    116
    @michaeltepl

    There is a discussion going on here about the push notification regression. The information Omar provided might work in a pinch (I created my own custom PostProcessor to handle the change, but his hacky solution seems less hacky than mine so I might switch to that for the time being).

    There is an open bug for this issue but your guess is as good as mine regarding if/when it'll be fixed.
     
  15. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Everyplay issue is separate one and should be fixed by upgrading Everyplay SDK to latest.
     
  16. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    663
    Well it doesn't give me that popup with the latest Everyplay version in the asset store. (Xcode 8 and iOS 10. i updated before i saw this post.)
     
  17. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    @Mantas-Puida

    Setting Application.targetFrameRate = 60; throws this error upon app launch on device : "invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. "

    Xcode 8, Unity 5.3.6p4 on both iphone 6s plus and ipad air 2 with iOS 10.

    Repoducable with empty project, leaving project at 30 fps seems ok.
     
  18. Kim-Shin-Wook-a-k-a-Forward-of-South-Korea

    Kim-Shin-Wook-a-k-a-Forward-of-South-Korea

    Joined:
    Sep 29, 2014
    Posts:
    3
    how about unity 4.x version? Is this version possible to build ios project with xcode8?
     
  19. dimitroff

    dimitroff

    Joined:
    Apr 3, 2013
    Posts:
    131
    These are the other fields you must add to your Info.plist, so your binary does not get rejected:

    NSCalendarsUsageDescription
    NSPhotoLibraryUsageDescription

    Just use arbitrary strings, if you are not using them.
     
    MrEsquire likes this.
  20. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    Don't know if it's related to this subject, if not, sorry. What's the current status of http links, do we have to use https link in game? If we use http, will it be rejected?
     
  21. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Ok- the patch is now live, start testing people :)
     
  22. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    @Mantas-Puida

    FYI, just tested with 5.4.1p1 and the same problem I've reported above still persists.

    Btw, Xcode debug CPU usage shows 95% now, it was around 50% with 5.3.6p4 for the same project. Is this normal?
     
  23. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    What are we 4.7 users supposed to do? I have half a dozen games that I can't upgrade to 5 but need to maintain and issue updates on 4.7
     
  24. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Yep, we also really need Unity 4.7 support. We've been working on a game for years and it's not feasible for an update to Unity 5.x, especially with all the lighmapping issues. We'd really appreciate another Unity 4.7 patch to address this.
     
  25. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    I keep getting asked why I can't upgrade to 5.x so I thought I'd just give my reasons here. Firstly the EULA, many of my games are casino games which I can't afford in the new 5.x Eula, secondly the last 2 games I ported from 4.x to 5.x cost me more than 2 weeks each to port. The initial port was only a few hours but then nearly all the 3rd party plugins needed to be updated too which cost me heaps of time, then there was the performance on Mobile issue, both ports more than halved my frame rate and I then had to spend weeks tracking down and changing stuff to get the frame rate back up. In short I have 11 more games live using 4.x on 3 platforms, I just can't sacrifice the time and money to convert these games.
     
  26. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    What about this one: NSBluetoothPeripheralUsageDescription

    I am using bluetooth in my app and got an error that I need this description as well. Is that the same as the location description or is it another one?

    If it is different, please add it into the patch for next week...
     
    MrEsquire likes this.
  27. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Where in the code do I add these, its strange that Unity not included all, maybe they know something we do not?
     
  28. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    663
    I think in info.plist like the rest.
     
    MrEsquire likes this.
  29. Russel

    Russel

    Joined:
    Oct 12, 2011
    Posts:
    40
    Apple says: "In iOS 10.0 and later, the value of advertisingIdentifier is all zeroes when the user has limited ad tracking."

    Is SystemInfo.deviceUniqueIdentifier ready for this changing?
     
    Wadjey likes this.
  30. eTech3D

    eTech3D

    Joined:
    Feb 2, 2014
    Posts:
    18
    +1 for Unity 4.7 support Patch :)
     
  31. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    This is the specific error I get:

    resource fork, Finder information, or similar detritus not allowed
    Command /usr/bin/codesign failed with exit code 1

    Trying to isolate where this comes from?
     
  32. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    App Transport Security becomes mandatory starting January 1, 2017. This is mostly affecting your backend servers and services.
     
  33. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    We are not adding fields for APIs that we do not support directly. You could either add them to Info.plist manually and keep appending Xcode project. Or write build post-processing script that adds it automatically via https://docs.unity3d.com/ScriptReference/iOS.Xcode.PlistDocument.html or simple text line injection way.
     
  34. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    You need them only if you have plugins that access Calendar or Photos. In this case it's plugins responsibility to inject required fields into Info.plist.
     
    MrEsquire likes this.
  35. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    If it's something coming from Unity site, bugreport would be welcome.
    Thanks!
     
  36. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Xcode 8 can build projects made with Unity 4.7, though you might have issues submitting them to store. In the short term I advice to continue using Xcode 7.3 for submissions.
    We are researching possibilities to produce another 4.7 build (including if our build farm is still capable of doing this). Though looking in the future any major requirement change, like making Bitcode mandatory, would make us impossible to provide it for Unity 4.7.x line.
     
  37. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Thanks for report. Looking into it.
     
  38. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Thanks dude, its not a Unity issue after all - its a change in Xcode 8

    I do not create SplashScreen + Icons in Unity due to poor quality of image outputted.
    Therefore override with own Photoshop created Images in Xcode, and it does not seem to like this.
    More info here if anyone has issue in future: https://forums.developer.apple.com/thread/48905
     
  39. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    Hey @Mantas-Puida / @PixelEnvision, I'm also seeing the 'invalid mode 'kCFRunLoopCommonModes' issue. Is this something to be worried about, and if so is there anything I can do this end to fix it?

    I'm getting a very choppy framerate on the iPhone 7 with an Xcode 8 build that is buttery smooth on an iPhone 5, which is slightly worrying - wasn't sure whether that could be related to the above issue. I'm going to fire up the profiler once I'm back at the work computer.
     
  40. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    Oh god another forced requirement madness.... I'd better hurry and publish the game before January.
    Has WWW support for encrypted connection improved? Last time I had a look on the forum, several months ago, it wasn't stellar.
     
  41. rsodre

    rsodre

    Joined:
    May 9, 2012
    Posts:
    229

    I don't understand why Apple is complaining about NSCameraUsageDescription since I do not use the camera in my game. There's no WebCamTexture in any script. Is it possible that some linked plugin dll is trying to access it directly?
     
    MrEsquire likes this.
  42. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Unity runtime includes camera code to implement WebCamTexture. In the patch release, which will ship this week this code is conditionally removed depending if your scripts are using WebCamTexture or not.
     
  43. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    We did reproduce this warning in Xcode console, but we didn't notice any negative side effects of it. It's caused by the code, which is helping with touch latency for games that are running at 60 FPS. We are investigating if this code is still needed for iOS 10. You can disable it in Unity generated Xcode project by editing Classes/UnityAppController+Rendering.mm file and changing:
    "#define ENABLE_RUNLOOP_ACCEPT_INPUT 1" to
    "#define ENABLE_RUNLOOP_ACCEPT_INPUT 0".
     
  44. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Do you have iOS WWW implementation in mind? I believe there were no https related issues any time recently. (Though there were few related to www object lifetime handling).
     
  45. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    Yes, talking of mobile in general using the WWW class.
    It's been quite a while since I checked on the forum but from what I remember some problems where:
    -Some crash when the certificate couldn't be verified.
    -Unable to work with self-signed certificates in certain platforms. Quite a pain for local testing.
    -Inability to verify certificate details, so the client could think it has connected to the server because the encrypted connection establish just fine, but in reality it is talking to a hack tool with a valid certificate that isn't the one you expect.

    Do both WWW and the new UnityWebRequest rely on high level platform API, or UnityWebRequest works with lower levels API?
    Because for example I just read a topic saying TLS 1.2 on Unity is supported only from Android 5.0, if it is the case with UnityWebRequest too, then need to support 2 scenarios on the server side too, one for IOS and Android >5 and one for Android <5.0.
     
  46. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    If this still happens bugreport would be very welcome.

    Self-signed certificates won't be compatible with Apple's App Transport Security requirement. In general we are leaving security checks to the OS. This can be customized in Xcode project.

    On iOS it will fail verification and connection will be aborted.

    Both of them are based on NSURLConnection API on iOS.

    I think server can support both 1.2 and older version, though iOS devices will insist on 1.2 via session initialization, so probably same server could serve both.
     
    00christian00 likes this.
  47. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    @Mantas-Puida I feel like touch latency is definitely more noticeable.

    Also noticed that the Replaykit preview window doesn't work (5.4.1p1).
     
  48. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Is it related to 60 FPS? Otherwise our QA was testing ReplayKit support on iOS 10 and it worked.
     
  49. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    I mean I've *never* been able to get ReplayKit working consistently, but I just tried it and after stopping recording Replaykit.recordingavailable was never changing to true (on an iPhone 7).
     
  50. rsodre

    rsodre

    Joined:
    May 9, 2012
    Posts:
    229
    I re-submitted my game using Unity 5.4.1p1, just to be rejected again.

    Now I see the original post edit ("This will be exposed in Player Settings for Unity 5.4.1p1"). I can fill the reason, but since I'm not using the WebCamTexture aPI, why's the game still requesting camera?

    I'm writing "Camera not used" in the field, and it sounds to me like a potential Apple rejection reason.

    At least we should have a build error asking to fill the field since it's already known the game will be rejected if it's empty.
     
    MrEsquire likes this.