Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Xcode 14.3 no application icons

Discussion in 'iOS and tvOS' started by pKallv, Apr 2, 2023.

  1. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,198
    When uploading directly to my iPhone from Xcode the app icon is not showing. I have tried to find the images.xcasset but not been able to. Anyone who knows how to make sure that I have an icon for my game on the iPhone in 14.3 and 2022.2.13f1.
     
    theolagendijk and Vukiz like this.
  2. Vukiz

    Vukiz

    Joined:
    Dec 11, 2014
    Posts:
    5
    The same issue, Icon assets are not copied on unity 2022.2.13f1
     
    theolagendijk likes this.
  3. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,198
    I did solve it.

    Created an asset file via new file in Xcode. Created asset named AppIcon and copied the icon in correct size and it worked.
     
    k1342685 and Vukiz like this.
  4. Vukiz

    Vukiz

    Joined:
    Dec 11, 2014
    Posts:
    5
    I just installed a 2022.2.11 and it worked. So it is a bug in 2022.2.13f1 version
     
    pKallv and theolagendijk like this.
  5. hsallander

    hsallander

    Joined:
    Dec 19, 2013
    Posts:
    47
    I got the same issue in our project with 2022.2.13. The
    Images.xcassets
    folder and content is actually copied to the correct place, but not included into the Xcode project.
     
    k1342685 and inspiredorange like this.
  6. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,628
    yeah, we broke this indeed. Will fix
     
    aimatme, newguy123, Vukiz and 3 others like this.
  7. danilo_unity17

    danilo_unity17

    Joined:
    Jan 16, 2023
    Posts:
    7
    If anyone wants a fix fot this on UCB or to build locally without issues:

    [PostProcessBuild]
    public static void ChangeXcodePlist(BuildTarget buildTarget, string pathToBuiltProject)
    {
    if (buildTarget == BuildTarget.iOS)
    {
    FIXXCAssets(pathToBuiltProject);
    }
    }

    private static void FIXXCAssets(string path)
    {
    #if UNITY_IOS
    UnityEngine.Debug.Log("Fixing XCAssets");
    var projPath = UnityEditor.iOS.Xcode.PBXProject.GetPBXProjectPath(path);

    UnityEditor.iOS.Xcode.PBXProject proj = new UnityEditor.iOS.Xcode.PBXProject();
    proj.ReadFromString(File.ReadAllText(projPath));

    var guidoARREF = proj.FindFileGuidByProjectPath("Unity-iPhone/ARReferenceImages.xcassets");
    proj.RemoveFile(guidoARREF);

    string xcAssetsFileGuid = proj.AddFile("Unity-iPhone/Images.xcassets", "Unity-iPhone/Images.xcassets");
    proj.AddFileToBuild(proj.GetUnityMainTargetGuid(), xcAssetsFileGuid);

    File.WriteAllText(projPath, proj.WriteToString());

    #endif
    }
     
    Last edited: Apr 12, 2023
    thorikawa, pKallv and AndreaGiulianoK like this.
  8. AndreaGiulianoK

    AndreaGiulianoK

    Joined:
    Mar 11, 2015
    Posts:
    6
    You saved my life!

     
  9. k1342685

    k1342685

    Joined:
    Oct 24, 2016
    Posts:
    1
    Can I just add this code to a random file and put it in my Unity Project or do I have to put this in the Xcode project after I build?
     
  10. markwjkelly

    markwjkelly

    Joined:
    Jan 28, 2017
    Posts:
    1
    How did you implement this fix?