Search Unity

Apple TV 4K (tvOS) - @2x app icons, top-shelf, launcher images

Discussion in 'iOS and tvOS' started by jason_yak, Sep 14, 2017.

  1. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    531
    Hi,

    Any chance we'll see the Unity editor updated with slots for the newly required @2x image slots any time soon? Particularly of note is the @2x launcher image which is required for tvOS apps to render at @2x resolution.

    Thanks,

    Jason
     
    gamecakestudios and Johannski like this.
  2. gamecakestudios

    gamecakestudios

    Joined:
    Nov 13, 2013
    Posts:
    21
    Ditto -- I am worried about getting my App Store submissions rejected if I don't import these manually after building from Unity.

    Does anyone know how to copy images over in a post-build script? I want to write a script to do this manually. Will share if I can get it figured out.
     
  3. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Use the `PostProcessBuildAttribute` to write a method that is called after the player is built. See here for more info!

    -sam
     
    sharkapps likes this.
  4. gamecakestudios

    gamecakestudios

    Joined:
    Nov 13, 2013
    Posts:
    21
    Thanks Sam. I've used that attribute before, but what I'm not sure about is accessing and modifying the json and bundle files within the xcode project. I know how to modify Plists and how to set build properties already.

    I would assume that the first step in this process would be copying files over into the Xcode project directory using PBXProject.GetPBXProjectPath, and then adding them into the project formally using PBXProject.AddFile.

    What I'm not sure about is how to modify the Contents.json files that xcode uses to track which images are associated with which resolution.
     
  5. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Ah right. This is slightly painful, but I would suggest building out to Xcode, setting up the top shelf etc images, save the Xcode project, and then examine what it's done to the project (keep a copy before you make the changes so you can diff it). Then you can use the PBXProject class to configure it appropriately, and update the Contents.json yourself as well. You'll also have to copy the images into the Xcode project directory.

    I guess I'll have to look into this soon too because we're planning on adding tvOS support to our game in our next update!

    Btw there's a more recent Xcode API at the Unity bitbucket account. However, I had a quick look and I couldn't see any updates for any of this stuff.

    -sam
     
  6. gamecakestudios

    gamecakestudios

    Joined:
    Nov 13, 2013
    Posts:
    21
    Darn. Was hoping there was a built in function for this somewhere in their API already that I wasn't seeing. I'll just use System.IO to edit the file the JSON file the old fashion way. Will post an update when I've got something working. Currently some more demanding things going on at the company.
     
  7. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Yeah sorry, I haven't seen anything yet! Not even a pull request against the Xcode API which I thought someone would have done.

    -sam
     
  8. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    531
    Hi all, I've just gone to submit an Apple TV build and there's some very odd things going on. I'm using the new icon slots added for Apple TV 4K using v2017.2.0p2 and for one they're generating files that are named wrong:

    TVOS-LargeIconLayer-0.png
    TVOS-LargeIconLayer@2x-0.png

    Should be:

    TVOS-LargeIconLayer0.png
    TVOS-LargeIconLayer-0@2x.png

    However this may not pose any big problem due to the content.json files pointing to the files. But I'd still change this in case there's some unknown Apple submission server issues that could result from this. All app icons files small and large, top shelf normal & wide are affected. The only file correct is the @2x launch image.

    But there's a far more strange issue going on. Before Apple TV 4K was released I manually created the icons adding them to xcode and had submitted a build to the app store following the icon design guidelines to add @1x and @2x versions for the small and large versions of the icon. However today I'm trying to submit and I'm getting this error:

    ERROR ITMS-90718: "Invalid Image Asset. The App Store Icon must only contain an image with size (1280pt × 768pt @1x). Refer to https://developer.apple.com/tvos/human-interface-guidelines/icons-and-images/app-icon for more information"

    Heading over to the docs and you'll find that there's now no mention to a @2x version of the app store icon??! How strange.
    https://developer.apple.com/tvos/human-interface-guidelines/icons-and-images/app-icon/

    This is so puzzling because I was able to submit with an @2x version of the large icon a month ago. But this totally answers something that I noticed when I was in an Apple store in Singapore. I used an Apple TV 4K obviously on a 4K TV, I brought up my app in the app store and could instantly tell that the icon looked blurry. All of the icons did. I figured this was just an early 4K tvOS bug. But now that I'm seeing that they've removed this from the docs and not even allowing apps to be submitted there seems to be a bit of an attempt to make out that this bug was intentional cause it clearly looks blurry and wrong on a 4K screen.

    So anyway... as it stands the files generated by Unity can not be used to submit a build. The build will not pass asset validation.
     
  9. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    531
    I'm just so confused about this... even Xcode has an @2x slot for the large icon though. Sounds like a disconnect between Apple software developers.
     
  10. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    531
    Just to confirm... if I manually remove the @2x icons from xcode my app is now passing app store submission asset validation.
     
  11. robertas-unity

    robertas-unity

    QA Minion Unity Technologies

    Joined:
    Mar 24, 2015
    Posts:
    29
    Hey @jason_yak, it does look like the files generated by Unity for AppleTV build fail to pass the asset validation when trying to submit the game to App Store. We will be working to fix this as soon as possible.
    As a temporary workaround, you can remove the 2x images from the generated 'App Icon - Large' icon in UnityImages.xcassets/AppIcon in Xcode project and re-archive the project. Uploading the project then should pass asset validation as expected.
    Thanks for your feedback!
     
    Lars-Steenhoff likes this.
  12. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    531
    Thanks, yea I'd already tried this and can confirm that worked. Cheers! =)
     
    samizzo likes this.
  13. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Any timeframe of when this fix will land ?
     
  14. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    531
    Hi there, I have an issue with the Top Shelf Wide @2x image. It's appearing a solid purple fill in the texture inspector (instead of the correct image) and also in the tvOS icon player settings. I've checked the texture import settings and have it set to 8192 max size, sprite, no compression. I've tried changing many other properties but they don't help. I'm using 2018.2.2.