[ios] appending an ios build fails due to missing launchimage path error

Sorry for the Upper case, I simply copy/paste the title from the original IssueTracker :

… which seems close already then I would like to know if someone found some fix for this.
I am running with the last 2020.0.2a12.

That is a bit annoying because the build needs to be “Replace” each time, the Append method only crash the following error :

Thanks!

1 Like

Yeah, I’ve been getting this on 2019.4.0. Submitted a bug report yesterday.

it is fixed and should be released sonish in both 2020 and 2019.4

1 Like

Any workarounds until the update for 2019.4 LTS is out? We updated to LTS to prevent exactly those untested things - it’s a little bit frustrating to be honest

2 Likes

To confirm everything is doing fine from 2020.2.0a13.
2020.1.0b12 is also stable.

Do you have an ETA for the release of the fix for 2019.4 ?

This issue is driving development time to crazy extents.

As a dirty workaround, keep this default catalog handy and just paste it in your build folder (/Unity-iPhone/Images.xcassets/) before you build. It will let the “append” build through and will get deleted automatically.
It’s really annoying doing this every time but better than wasting minutes with the replace option :smile:

5994083–645002–LaunchImage.launchimage.zip (11.7 KB)

You only need the “LaunchImage.launchimage” directory, not its contents.

Here’s a build preprocessor that creates it automatically before each build:

using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;

public class IosAppendExceptionFix : IPreprocessBuildWithReport
{
    public int callbackOrder => 0;

    public void OnPreprocessBuild(BuildReport report)
    {
        if (report.summary.platform != BuildTarget.iOS)
            return;

        var buildPath = report.summary.outputPath;
        var catalogPath = Path.Combine(buildPath, "Unity-iPhone", "Images.xcassets");
        if (!Directory.Exists(catalogPath)) {
            Debug.LogError("Could not find assets catalog at path: " + catalogPath);
            return;
        }

        var launchimagePath = Path.Combine(catalogPath, "LaunchImage.launchimage");
        if (Directory.Exists(launchimagePath)) {
            // Nothing to do
            return;
        }

        Debug.Log("Created LaunchImage.launchimage directory to work around exception during Unity iOS append builds");
        Directory.CreateDirectory(launchimagePath);
    }
}
15 Likes

Thank you so much!

On a side note, what does callbackOrder => 0; do?

That’s modern C# syntax for public int callbackOrder { get { return 0; } }. It’s called expression bodied members.

Hi guys,

I receive below errors:

/_Scripts/IosAppendExceptionFix.cs(4,19): error CS0234: The type or namespace name ‘Build’ does not exist in the namespace ‘UnityEditor’ (are you missing an assembly reference?)
Assets/_Scripts/IosAppendExceptionFix.cs(5,19): error CS0234: The type or namespace name ‘Build’ does not exist in the namespace ‘UnityEditor’ (are you missing an assembly reference?)

and so on…

Anybody have an idea what is wrong?

@savantedroid I would advise to mention the Unity version you are using when pasting error :wink:

1 Like

@savantedroid You need to place the script in a folder called Editor. You can place that Editor folder as a subfolder anywhere in your project hierarchy, doesn’t have to be at top-level.

2 Likes

hi I have another question, after rebuild the project, the podfile has been overwrite too.
I have to copy a copy and overwrite it on the file
And execute pod install once
Is this related to this script, or is it a current bug in 2019.4.lts?

@Adrian thank you so much

Thank you so very much for this fix, works like a charm (Using unity 2019.4.1f1)

1 Like

Its now listed as being fixed in 2019.4 - but I just updated to 2019.4.2f1 - still not fixed…

4 Likes

Serious Bug in Unity: All of the IOS, Apple TV, and devs on my team are unable to build due to Unity not properly creating the new spec for Launchscreen.storyboard, or adhering to the xcode project storyboard build implementation for Apple Devices.

Also, the 2020 builds arent recognizing the new Metal implementation in the builds they create now for some reason… something to do with Apple new Arm64 builds and a huge issue with Unity creating the Game Center capability in xcode project builds…

Unfortunately because of this, we have to stop our updates to IOS and Apple’s App Store this month until a bug fix comes through for 2019.4 LTS or 2018.4 LTS.

Diving into Xcode to solve the launchscreen storyboard issue is very troubling for our studio due to the nature of how much we create new ios updates and builds… please help us Unity :cry:

1 Like

Is there a Bug task link to monitor in which version of Unity this will be fixed?

updated to 2019.4.3f1 - and it seems to be fixed, at least it works for me!

2 Likes