Search Unity

This Bundle is invalid UIRequiredDeviceCapabilities.

Discussion in 'iOS and tvOS' started by AlukarDrol, Apr 7, 2020.

  1. AlukarDrol

    AlukarDrol

    Joined:
    Jan 29, 2017
    Posts:
    13
    Hello.
    I updated Unity to 2019.3. And he began to collect for ios on Cloud Build 2019.3. When uploading .ipa to AppleStore, they wrote me such a warning.

    "This bundle is invalid. The key UIRequiredDeviceCapabilities in the Info.plist may not contain values that would prevent this application from running on devices that were supported by previous versions."

    I am building with Cloud Build and submitting .ipa via the old mac. And I just can’t build on it through xcode on it. What should I do to remove this warning?
     
  2. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
    I have this too updating an app to 2019.3. Looking in Xcode, "Required device capabilities" are armv7 and metal. This is a problem. Can I safely remove either of these?
     
    AlukarDrol likes this.
  3. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
    Found the problem: it's requiring Metal.

    In Player Settings for iOS, under Other Settings, uncheck "Auto Graphics API", then add OpenGLES3 and OpenGLES2 below Metal. They will be listed as deprecated, but Apple requires that all updates to an app continue to support all customers that have purchased that app. So you must have these if your app shipped before Metal.
     
  4. VGMFR

    VGMFR

    Joined:
    Nov 22, 2014
    Posts:
    8
    Thanks a lot for this dude, you just saved me one day of investigation!
     
    _Radagan likes this.
  5. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
    No worries. Glad to be able to help. Unity plus Apple can run anyone a little crazy! When it works it's great, but when it doesn't...
     
    IlisanVlad likes this.
  6. victorw

    victorw

    Joined:
    Sep 14, 2016
    Posts:
    459
    Can confirm! :confused:
     
    dzeriho likes this.
  7. N1kel

    N1kel

    Joined:
    Jun 27, 2013
    Posts:
    5
    @victorw am I understanding correctly that if we have an app that used to support OpenGLES and now with new Unity it only supports Metal we will not be able to publish it under the old name in the AppStore? Is there a way to publish an update without supporting older API? I looked and it seems all the iPhones since 5S support Metal so it should not be a problem for almost any Unity app as userbase is already 5s+ for most of the games on Unity I am sure.

    It looks like our only 2 options are:
    1) stick to unity 2019.3.x with although deprecated but still a support for OpenGLES with no upgrade paths
    2) release and app with metal requirement under a new name on the AppStore (which is unrealistic for a an app with established playerbase)

    Is there and easy way out or it's just Apple things? Can we just not include the metal key in the UIRequiredDeviceCapabilities and sort it out through maybe iOS version like 12+ (all devices with 12.0 iOS capabilities have Metal support, and it seems like an middle ground solution if Apple allows it)?
     
    Last edited: Apr 27, 2020
  8. victorw

    victorw

    Joined:
    Sep 14, 2016
    Posts:
    459
    I'm a UCB developer not a platform developer - I don't actually know very much about the apple ecosystem apart from Xcode/Fastlane build scripts (and also the pain of new OSX versions). The iOS forums would probably be able to help you better.

    With that said, yeah that does sound correct to me based on what's said in the thread. I don't think it should be a huge problem if 2020 Unity does not support OpenGLES since 2019.4 should still support it and best practice is to stick to LTS versions for any game that's currently in production. By the time support for the LTS version ends you should have a clear picture of what the migration path would be for your users.
     
    Garth and N1kel like this.
  9. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    168
    I'm having this same problem. Just to clarify, we're using 2019.4, and previously supported OpenGLES. The "fix" for this at the moment is to just uncheck Auto Graphics API and add in OpenGLES to the list, that is fine for now. But as these are marked as deprecated, I assume they'll likely be removed in 2020. We have no plans as yet to update anything to 2020, but there isn't a pathway yet to continue support for these older games once OpenGLES is removed?
     
    bigbrainz and Drakoran like this.
  10. rockdevels

    rockdevels

    Joined:
    Mar 2, 2017
    Posts:
    5
    just remove "metal" from RequiredDeviceCapabilities
     
  11. Drakoran

    Drakoran

    Joined:
    Feb 20, 2016
    Posts:
    2
    Is there any confirmation on this? I'd hate to have to be stuck at this version for the life of the app.
     
  12. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    168
    Ok, so I’m having a similar problem now with unity 2019.4.8 with arm64 being set as a required capability when updating my older game.

    is there a way to programmatically set the required capabilities?
     
  13. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99
    We are having the same issue. Unity seems to be overriding the setting for arm64 after the post build scripts or something. I tried setting it to an empty array during post, but its being overridden.

    Its stopping us from releasing updates to any of our current games at the moment and I'm not able to find a way around it! @victorw - is there a work around or is this a known issue that is being fixed?
     
  14. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
  15. bigbrainz

    bigbrainz

    Joined:
    Jul 21, 2015
    Posts:
    177
    We're also having to delete the "Required device capabilities" in XCode like _Radagan mentions. We would like the ability to define those settings in Unity--or maybe there's a way to do it that we just don't know.
     
    Paul_H23 likes this.
  16. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
    The work around is to edit the project's info.plist in Xcode to remove the arm64 entry, then build your archive and upload as usual.
     
  17. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
    Well, I don't have anything coded to remove the arm64 programmatically, but I do add to the info.plist in order not have to deal with the export cryptography statement after upload.

    This sort of approach should give you access to what you need to remove the arm64 entry and get your automated builds running again. Unity should fix the bad setting, but in the meantime...

    Here's code I picked up on the forum and modified to add to the info.plist the ITSAppUsesNonExemptEncryption = NO requirement:
    Code (CSharp):
    1. #if UNITY_IOS
    2. using UnityEngine;
    3. using UnityEditor.Callbacks;
    4. using UnityEditor;
    5. using UnityEditor.iOS.Xcode;
    6. using System.IO;
    7.      
    8. public class Export
    9. {
    10.     [PostProcessBuild]
    11.     public static void ChangeXcodePlist(BuildTarget buildTarget, string pathToBuiltProject)
    12.     {
    13.         // Performs any post build processes that we need done
    14.         if( buildTarget == BuildTarget.iOS )
    15.         {
    16.             // PList modifications
    17.             {
    18.                 // Get plist
    19.                 string plistPath = pathToBuiltProject + "/Info.plist";
    20.                 var plist = new PlistDocument();
    21.                 plist.ReadFromString(File.ReadAllText(plistPath));
    22.      
    23.                 // Get root
    24.                 var rootDict = plist.root;
    25.      
    26.                 // Add export compliance for TestFlight builds
    27.                 var buildKeyExportCompliance = "ITSAppUsesNonExemptEncryption";
    28.                 rootDict.SetString( buildKeyExportCompliance , "false" );
    29.                    
    30.                 // Write to file
    31.                 File.WriteAllText( plistPath , plist.WriteToString() );
    32.             }
    33.         }
    34.     }
    35. }
    36. #endif
    The script goes under Assets/Editor.

    Oh and the key I think you need to look for is: UIRequiredDeviceCapabilities
     
    Last edited: Aug 19, 2020
  18. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    168
    I tried doing something similar and just overriding the UIRequiredDeviceCaps with an empty array item, but it didn't seem to work. Really need some feedback from Unity on this asap...
     
  19. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
    Actually, an empty array shouldn't work. It needs a String item of "armv7" for Universal builds. The key is not to have both "armv7" and "arm64". You're listing the minimum architecture your app supports.
     
  20. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    168
    hmm - thats interesting. When I managed to fix the Metal thing, clearing out the flags seemed to make it work - but I'll give it a go and feedback.

    Thanks!
     
  21. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
    No worries. I hope it works!
     
  22. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    168
    unfortunately not it seems:

    Code (csharp):
    1. Invalid Bundle. You've included the "arm64" value for the UIRequiredDeviceCapabilities key in your Xcode project, indicating that your app may only support 64-bit. Your binary, 'com.motionlab.nored', must only contain the 64-bit architecture slice.
    It seems by including it, it causes the error. It seems we need a way to remove it - which is why I thought the empty array might work.
     
  23. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
    Hum... Are you sure your array for UIRequiredDeviceCapabilities only has one element? That element should be String: "armv7". If it has both "armv7" and "arm64, then you have exactly what Unity is adding.
     
  24. _Radagan

    _Radagan

    Joined:
    May 16, 2014
    Posts:
    38
    Actually, it might have other entries, but it can't have "arm64" or you will get the error above that you quoted.
     
  25. fiveampsoftware

    fiveampsoftware

    Joined:
    Feb 9, 2015
    Posts:
    33
    I've been unable to successfully upload an Universal iOS binary with Unity 2019.4.8f1 due to this.

    I've tried disabling AutoGraphicsAPI & and adding OpenGLES3, but got the same error. Also tried removing Metal and only having OpenGLES3 in the Graphics APIs area - still fails with the same error as in the original post.
     
  26. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    168
    I'm going to do a build on my mac today and see what I get with my post processing script. I've been pushing this straight to cloud at the moment, so takes a bit longer to test. Hoped it was going to be quick fix.

    I'm not sure at what point Unity adds the arm64 string to the plist - it may be happening after I've run my script I guess, so its going in regardless.
     
  27. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    168
    ok - I've tried a few things now, and nothing works to get rid of it!

    I've tried setting it to the last Post process job, added armv7, set it as an empty array and Unity always comes in and adds arm64. I'm guessing its part of the xcode template or something that Unity is using?

    Completely screwed though until there is a fix - I can't update any of my games!
     
  28. Deleted User

    Deleted User

    Guest

    I just ran into the same problem with arm64 and am working on it right now.

    I changed "Player Setting - iOS - Other Settings - Architecture" from Universal to armv7. It successfully removed arm64 from UIRequiredDeviceCapabilities in Info.plist.

    Not sure if this change has any side effects yet.
     
  29. Deleted User

    Deleted User

    Guest

    Oops, the architecture change results in multiple changes in Unity-iPhone.xcodeproj.

    I guess we should not do that.
     
  30. brockemon

    brockemon

    Joined:
    Dec 21, 2012
    Posts:
    48
    Also having the Arm64 inclusion issue. Guess manual exclusion with post build script is the only way to go right now
     
    Deleted User likes this.
  31. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99
    I've looked into doing this, but it seems that unity is doing it AFTER our post process is run (or just part of the template)

    Unless I'm doing something wrong with it. I tried setting the post process step the int.maxValue to ensure its right at the end of everything, and it does run... but no matter what, the arm64 string still gets written in there.
     
  32. brockemon

    brockemon

    Joined:
    Dec 21, 2012
    Posts:
    48
    Reporting back. I did the post build method. Seems to work. I did notice that sometimes it doesn't work but most of the time arm64 is removed from the list.
     
  33. TheFellhuhn

    TheFellhuhn

    Joined:
    Feb 3, 2017
    Posts:
    42
    I have only armv7 in the plist as requirement. Yet Apple doesn't accept any builds as it doesn't allow to install on iPads (which is wrong as I have other apps with the same settings which work on iPads). It is also the first build of that app so it is not denied because it supports less devices. The reviewer also links to non-existant documentation. This is a mess. :(

    Both metal and the two OpenGL APIs are added.
     
  34. p0w1nd

    p0w1nd

    Joined:
    Oct 28, 2015
    Posts:
    140
    uncheck "Auto Graphics API", then add OpenGLES3 and OpenGLES2 below Metal.

    This works! Thank you very much!!
     
  35. Noelooo3

    Noelooo3

    Joined:
    Feb 13, 2019
    Posts:
    1
    Add OpenGLES3 and OpenGLES2 didn't fix the problem for me.

    However, our game had arm64, arkit, and metal in the info.plist. Just simply removed arkit from the list fixed the problem.

    The reason I removed arkit because I kind of remember arkit was not required when we uploaded our game to Apple for the first time. Tho the previous version built with Unity 2019.2.11 had the same string and had no problem during uploading...

    Have no idea what's going on with this but check your very first info.plist might help.
     
  36. maxim_kornilov

    maxim_kornilov

    Joined:
    May 29, 2018
    Posts:
    5
    Just for reference, this is a post build script which removes
    arm64 
    item from
    UIRequiredDeviceCapabilities
    collection.

    Code (CSharp):
    1. using System.IO;
    2. using UnityEditor;
    3. using UnityEditor.Callbacks;
    4. using UnityEditor.iOS.Xcode;
    5.  
    6. public class PostProcessBuild
    7. {
    8.     [PostProcessBuild(9999)]
    9.     public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
    10.     {
    11.         if (target == BuildTarget.iOS)
    12.         {
    13.             RemoveArm64FromRequiredDeviceCapabilities(pathToBuiltProject);
    14.         }
    15.     }
    16.  
    17.     private static void RemoveArm64FromRequiredDeviceCapabilities(string pathToBuiltProject)
    18.     {
    19.         string plistPath = Path.Combine(pathToBuiltProject, "Info.plist");
    20.         var plist = new PlistDocument();
    21.         plist.ReadFromString(File.ReadAllText(plistPath));
    22.  
    23.         var rootDict = plist.root;
    24.  
    25.         var capabilities = rootDict["UIRequiredDeviceCapabilities"].AsArray();
    26.         capabilities.values.RemoveAll(item => item.AsString() == "arm64");
    27.  
    28.         File.WriteAllText(plistPath, plist.WriteToString());
    29.     }
    30. }
     
    Last edited: Sep 8, 2020
  37. TheFellhuhn

    TheFellhuhn

    Joined:
    Feb 3, 2017
    Posts:
    42
    For those with similar troubles: I didn't have arm64 in the required capabilities and was rejected nonetheless. Just resubmitted a new binary (same compile) with the comment that they should do their job better and it went through.
     
  38. eli_grinline

    eli_grinline

    Joined:
    Nov 22, 2016
    Posts:
    4
    I just had this very issue...it was the "Invalid Bundle. You’ve included the “arm64” value for the UIRequiredDeviceCapabilities key in your Xcode" one.

    If you go to your info.plist and toggle open the "Required Device Capabilities" you probably have a stack of architectures. I had about 8 "arm64" and one "armv7" in my list. I just deleted all of them except the "armv7" and it built with no issues.
     
    FarizBadalzade likes this.
  39. Burn0815

    Burn0815

    Joined:
    Jul 3, 2019
    Posts:
    11
    thanks for sharing your solutions!
    removing arm64 from "Info.plist > Required device capabilities" worked for me too. Unity 2019.4.8 Player Settings > Other> Architecture: Universal
     
  40. Tech-Unity3d

    Tech-Unity3d

    Joined:
    Apr 25, 2016
    Posts:
    11

    I also facing the same issue -"Invalid bundle". I am using the AR foundation for the IOS platform which only runs on Metal graphic API and ARM64. So I cannot remove arm64. Can you please help me how I fix this issue?
     
  41. EtienneMarbotic

    EtienneMarbotic

    Joined:
    Aug 14, 2017
    Posts:
    1
    @Tech-Unity3d for your case, you should build with the ARM64 Architecture only, and not in Universal mode. (To change this settings, you need to go to: "File > Build Settings > Player Settings > iOS tab > Other Settings part > Architecture"
     

    Attached Files:

  42. Midiphony

    Midiphony

    Joined:
    Jan 25, 2019
    Posts:
    14
    Hey Alan ! Did you manage to fix this issue ?

    I am trying to update an app, with a "armv7" UIRequiredDeviceCapability.
    The plist file in the Unity project and the one inside generated Xcode projects indeed have this key.

    However, no matter what I do (editing plist's UIRequiredDeviceCapabilities in XCode or during PostProcess), the final build doesn't have the same keys in the capabilities : "arm64" UIRequiredDeviceCapability is added and "armv7" is removed. This prevents me from submitting the app update, as I am getting the following error :
    I am on Unity 2018.4.24f1.

    I also noticed this happens when the minimum iOS version targeted is 11. It stops happening when the minimum iOS version targeted is set back to 10 but we cannot use this "workaround".
     
    Last edited: Nov 1, 2020
  43. fiveampsoftware

    fiveampsoftware

    Joined:
    Feb 9, 2015
    Posts:
    33
    As a work around we are using this in our OnPostprocessBuild(BuildReport report)
    Code (CSharp):
    1. //arm64 removal (u2019 build upload issue) https://forum.unity.com/threads/this-bundle-is-invalid-uirequireddevicecapabilities.862570/
    2.  
    3. string plistPath = Path.Combine(report.summary.outputPath, "Info.plist");
    4. PlistDocument plist = new PlistDocument();
    5. plist.ReadFromString(File.ReadAllText(plistPath));
    6. PlistElementDict rootDict = plist.root;
    7. var capabilities = rootDict["UIRequiredDeviceCapabilities"].AsArray();
    8. capabilities.values.RemoveAll(item => item.AsString() == "arm64");
    9. File.WriteAllText(plistPath, plist.WriteToString());
    10.  
     
    Endahs likes this.
  44. amoraleite

    amoraleite

    Joined:
    Oct 16, 2014
    Posts:
    41
    Thank you ! Solve to me.
     
  45. Paul_H23

    Paul_H23

    Joined:
    Jun 19, 2019
    Posts:
    45
    I have a question, if anyone from Unity is listening. Does Unity ever actually test this stuff? As far as I can tell, with the new requirement for arm64 support from Apple, and the fact that building for universal in Unity automatically puts both the armv7 and arm64 tags into the UIRequiredDeviceCapabilities entry in Info.plist, it's impossible to upload a build to Apple without manually modifying the Info.plist in XCode first.

    If I'm wrong, please point me towards the area in Unity that I can update to stop these flags being added to Info.plist, if I'm right, it means that nobody at Unity has uploaded an iOS app to Apple for a while, which, well, doesn't fill me with confidence.
     
  46. victorw

    victorw

    Joined:
    Sep 14, 2016
    Posts:
    459
    This thread seems to have moved away from being UCB-related and turned into a general problem-solving thread for Unity iOS problems - I'm going to move it into the iOS forums so that it has better visibility for the iOS Platform team.
     
  47. noambe

    noambe

    Joined:
    Aug 13, 2014
    Posts:
    32
    Saved my day. How did find out it required Metal?
     
  48. Tech-Unity3d

    Tech-Unity3d

    Joined:
    Apr 25, 2016
    Posts:
    11
    Remove from unity3d editor and export it for xcode. After that you add metal in xcode project plist info.
     
  49. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
    Came here for the same issue when updating an app after upgrading Unity.

    Old app required armv7, after updating Unity this changed to armv7 & metal.

    Is there any difference between just removing metal from the plist and changing auto graphics api to having all 3 listed (see image), both plists on output xcode project seem to be the same. When I added the graphics api though, Unity seemed to be reimporting all the assets?



    Found PostProcessBuildAttribute to remove metal here
    https://answers.unity.com/questions/1720346/unity-20192-to-20193-ios-app-upload-error.html
     
    Edan-Smith likes this.
  50. Swah

    Swah

    Joined:
    May 13, 2015
    Posts:
    80