Packaging iOS as a framework

I’m running into some issues with packaging up the iOS version as a framework. Here’s what I’ve tried so far:

  • checked “export as a framework”
  • Set provisioning profile & certificate
  • File → Package Project → iOS

This is where the first errors pops up

UATHelper: Packaging (iOS): ERROR: MyProject modifies the value of bShouldCompileAsDLL. This is not allowed, as MyProject has build products in common with UE4Game.
UATHelper: Packaging (iOS): Remove the modified setting, change MyProject to use a unique build environment by setting 'BuildEnvironment = TargetBuildEnvironment.Unique;' in the MyProjectTarget constructor, or set bOverrideBuildEnvironment = true to force this setting on.
PackagingResults: Error: MyProject modifies the value of bShouldCompileAsDLL. This is not allowed, as MyProject has build products in common with UE4Game.
  • In attempt to fix, I open MyProject.Target.cs and modify it to look like this:

    using UnrealBuildTool;

    public class MyProjectTarget : TargetRules
    {
    public MyProjectTarget(TargetInfo Target) : base(Target)
    {
    Type = TargetType.Game;
    BuildEnvironment = TargetBuildEnvironment.Unique;
    ExtraModuleNames.Add(“MyProject”);
    }
    }

  • I rebuild, but get this message:

    MyProject.uproject requires a temporary target.cs to be generated (SunPosition plugin is enabled)

  • This regenerates the MyProject.Target.cs file without the added ‘ BuildEnvironment = TargetBuildEnvironment.Unique;’ line.

  • I disable the plugins so that the file is not regenerated (just attempting to get it to work, I know this isn’t a permanent solution).

  • The build succeeds this time, however the file created. Is a .ipa file and I’m looking for a .framework file.

I’ve tried this process on both 4.25 and the 4.26 preview.

I must be doing something wrong? There must be some sort of intermediary step in there?