Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

1303: ▸ ❌; error: Value for SWIFT_VERSION cannot be empty. (in target 'UnityFramework' from project

Discussion in 'Unity Build Automation' started by Yakirbu, Feb 16, 2020.

  1. Yakirbu

    Yakirbu

    Joined:
    May 7, 2015
    Posts:
    28
    While using UCB to build for iOS, in Unity 2019.3.1f1, getting this error:

    1303: ▸ ❌; error: Value for SWIFT_VERSION cannot be empty. (in target 'UnityFramework' from project 'Unity-iPhone')


    tried to add post process build -
    proj.SetBuildProperty(targetGuid, "SWIFT_VERSION", "3.0");
    Didn't help.

    Any ideas?
     
  2. nbaris

    nbaris

    Joined:
    Jan 13, 2015
    Posts:
    27
    I had a similar issue after adding the Facebook SDK (Unity 2019.3.11f1). It may be a bit hacky, but updating all swift versions in the project file itself works:

    Code (CSharp):
    1.  
    2. string projPath = UnityEditor.iOS.Xcode.PBXProject.GetPBXProjectPath(path);            
    3. string projText = File.ReadAllText(projPath);
    4. projText = Regex.Replace(projText, "SWIFT_VERSION = [^;]*;" , "SWIFT_VERSION = 5.0;", RegexOptions.Multiline);
    5. File.WriteAllText(projPath, projText);
     
  3. pdafedar

    pdafedar

    Joined:
    Apr 17, 2018
    Posts:
    9
    Code (CSharp):
    1. project.SetBuildProperty(targetGuid, "SWIFT_VERSION", "5.0");
     
  4. PorpoiseStudios

    PorpoiseStudios

    Joined:
    Oct 12, 2019
    Posts:
    6