Search Unity

'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but range is 8.0 to 13.2.99

Discussion in 'Unity Build Automation' started by mitchell_unity439, Jan 24, 2020.

  1. mitchell_unity439

    mitchell_unity439

    Joined:
    Nov 22, 2019
    Posts:
    1
    Hi all.

    First post here.

    We are developing a hybrid Cardboard app, with Google Cardboard SDK for Unity / iOS (latest v. 1.200.1). Unity version 2019.2.x. We are using Cloud Build for iOS test process.

    Our build is successful. However, the resulting app does not launch on iPhone (iOS 13.3) saying that version of the app is too old / not supported. The very same build done locally yields an app that launches correctly.

    Going through the UCB logs we found these:

    It appears that the 'GVRSDK' pod (as in Cocoapods) depends on GTMSessionFetcher and GoogleToolboxForMac; these pods however set an IPHONEOS_DEPLOYMENT_TARGET that is too old.

    Are we on the right track? How can we set a custom IPHONEOS_DEPLOYMENT_TARGET that UCB will observe?

    Is this something that needs to be addressed in PostProcessBuild at a Unity level? If yes, how?

    Thank you in advance for your time and help.

    mbs
     
  2. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,089
    It sounds like a potential issue with cloud build if it's working locally. You could probably fudge it a bit by setting the plist value directly or by modifying the xCode project in the PostProcessBuild like you mentioned. Here's some code that will set the minimumOSVersion (deployment target gets passed to this) in the plist file to 13.0:

    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. // Post process for iOS build
    9. public class AddMinOS
    10. {
    11.     [PostProcessBuild]
    12.     public static void ChangeXcodePlist(BuildTarget buildTarget, string pathToBuiltProject)
    13.     {
    14.         UnityEngine.Debug.Log( "ChangeXcodePlist" );
    15.      
    16.         // Info.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.             // Set minimum OS to 13
    27.             var buildKeyMinOS = "MinimumOSVersion";
    28.             rootDict.SetString(buildKeyMinOS, "13.0");
    29.  
    30.             // Write to file
    31.             File.WriteAllText(plistPath, plist.WriteToString());
    32.         }
    33.     }
    34. }
    35. #endif
    Save the code in Assets\Editor\AddMinOS.cs
     
    Eckual and elaine_unity694 like this.