Download

I'm having troubles building a code plugin for Mac/iOS, any advice?

Hello Everybody,

I am seeking advices about the correct way to build and publish a plugin for Mac/iOS. I have already published successfully my plugin GC FSM for all other platforms and I am not aware of anything that could prevent the plugin from running on them. Yet, I have to disable support for those platforms because the Marketplace team keeps rejecting the plugins if I enable them. The fact is that the errors that I have being reported are all about something that is totally unrelated with my code and that is apparently out of my control. This situation is very frustrating and makes me think if anyone has ever published a code plugin for Mac/iOS… Since apparently the answer is yes, I hope some good soul can help me.

For example, the latest error that I have been reported is about something in UnrealType.h:


 
In file included from /Users/build/RocketSync/4.18.0-3709383+++UE4+Release-4.18/Working/Engine/Source/Editor/UnrealEd/Public/UnrealEdSharedPCH.h:280:
       Runtime/CoreUObject/Public/UObject/UnrealType.h:3285:37: error: lambda capture 'LocalMapLayoutForCapture' is not used -Werror,-Wunused-lambda-capture]
                               [LocalKeyPropForCapture, KeyPtr, LocalMapLayoutForCapture](void* NewElementKey)


This is clearly a warning that has been escalated to an error. Beside the obvious question of why is this warning-prone code present in one of the most included header files of the engine, how do I disable the warning or at least prevent the escalation?

I am also been reported that I do not support IWYU… except that I do that on all the other platforms, so I frankly don’t know how I could ever not do that on Mac too, since the build scripts do not introduce any per-platform differences.

I hate to say that, but the Marketplace team has been very little helpful about this issues, they just copy&paste the error messages and require me to provide a fix. In another case, not mentioned here, it took me an entire day of investigation to find out that it was a bug in the 4.19 toolchain, which I could not fix in any way… when I answered them that I was stumped, they admitted they knew all that.

Why is the Mac/iOS not getting the same love as the other platforms?

Thanks for any advice,

I’ve had the same issue and had to workaround it by not supporting Mac/IOS in engine versions below 4.19 (in which the issue has been fixed).

The problem is caused by using XCode 9.3 and higher. There are numerous answerhub reports about it which state the only solution is to downgrade to XCode 9.0. I imagine Epic are using the latest version, so unfortunately unless they patch prior versions of the engine - there is no viable fix for them.

Reports:
https://answers.unrealengine.com/que…ml?sort=oldest
https://answers.unrealengine.com/que…ml?sort=oldest
https://answers.unrealengine.com/que…ml?sort=oldest

I did have a brief back and forth with the Marketplace team member looking at the plug-in, but didn’t get a response about the XCode issue. There is a specific commit on Git that fixes the problem but I can’t find it right now unfortunately (it’s in one of the many answerhub reports).

What strikes me is that this issue can be fixed by a simple one-line addition in function GetCompileArguments_Global in MacToolChain.cs:


Result += " -Wno-error:unused-lambda-capture";

However, are you saying that you were able to publish a plugin supporting Mac in 4.19? I ask that because I was rejected on that version too. Did you do anything fancy in your build.cs files? This is mine:



namespace UnrealBuildTool.Rules
{
    public class GCFSMEditor : ModuleRules
    {
        public GCFSMEditor(ReadOnlyTargetRules Target) : base(Target)
        {
            PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

            PrivateIncludePaths.Add("Editor/Private");

            PrivateDependencyModuleNames.AddRange(
                new string] { /* list of modules here */ });
        }
    }
}