ARKit: UE4-MetalRHI.dylib is missing, can't compile editor in Xcode Beta

Thank you!

I’m still getting this error:

ERROR: UBT ERROR: Failed to produce
item:
/UnrealEngine-dev-ar-kit/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-MetalRHI.dylib

After updating the renderCommandEncoder:

- (nullable id<MTLRenderCommandEncoder>)renderCommandEncoder
{
    return [[[FMetalDebugRenderCommandEncoder alloc] initWithEncoder:[Inner renderCommandEncoder] andCommandBuffer:Buffer] autorelease];
}

A Preprocess compile of ‘MetalParallelRenderCommandEncoder.cpp’ reads:

‘MetalParallelRenderCommandEncoder.cpp’
is not a member of any targets in the
current scheme that build for
profiling

I have limited experience with Xcode, but it seems this is preventing me from being able to compile any iOS apps, regardless of whether I build and package from the Epic Launcher version of Unreal or from the github master via Xcode.

A sample platformer proj would not package in UE4 editor via Epic Launcher (4.15) and it is also throwing an error related to UE4Editor-MetalRHI.dylib

It shouldn’t be a machine limitation as it’s an MBP new from the last year.

I feel like I’ve overlooked something…

Appreciate your help, again!

Hi, thanks again so much for your help.

I do intend to use the beta UE4 Editor with beta xcode, as that’s the only current setup that supports the experimental ARKit plugin.

I’d definitely like to check out the AR Sample, but am more so interested in developing with the ARkit plugin than just trying out the sample.

Per the instructions, I’ve been building for development editor. Should I be compiling and building for debug instead?

Currently the process has been -

Download the ARkit branch, unzip and run the Setup Command to download the UE4 master branch and dependencies.

Run Generate Project Files command.

Open the xcode workspace, build ShaderCompileWorker (debug) and UnrealLightmass (debug) and then I change the flags to ARSample to build for development editor, targeting my Mac.

No matter what, I’m always stuck hanging with an error in MetalRHI.cpp file

I appreciate greatly your time helping and looking into this! I understand the very experimental nature of what I’m trying to do and can come to terms with whatever the outcome is :slight_smile:

Hi,

Please try the following:

Open the workspace in Xcode Version 9.0 beta 2 (9M137d).

Use the Product > Scheme > ShaderCompilerWorker menu item. Use the Product > Scheme > Edit Scheme menu item (COMMAND + <) Look at the list of configurations on the left side of the popup window and ensure The Run , Test, Profile, Analyze, and Archive configurations all have the word “Development” listed beside them. This should be the default setting. Close the popup dialog. Use the Product > Build menu item

Use the Product > Scheme > UnrealLightmass menu item. Use the Product > Scheme > Edit Scheme menu item (COMMAND + <) Look at the list of configurations on the left side of the popup window and ensure The Run , Test, Profile, Analyze, and Archive configurations all have the word “Development” listed beside them. This should be the default setting. Close the popup dialog. Use the Product > Build menu item

Use the Product > Scheme > ARSample menu item. Use the Product > Scheme > Edit Scheme menu item (COMMAND + <) Look at the list of configurations on the left side of the popup window and ensure The Run , Test, Profile, Analyze, and Archive configurations all have the word “Development Editor” listed beside them. This should be the default setting. Close the popup dialog. Use the Product > Build menu item

You should find /UnrealEngine/Engine/Binaries/Mac/UE4Editor.app has been created for you. Launch it by double-clicking the app file.

This should help you out. Let me know if you have issues. Cheers,

I got it building by running git clone and then

git checkout remotes/origin/dev-ar-kit

then running the coffin scripts mentioned in the readme

Then adding the nullable keyword.

I am currently trying to run the editor :open_mouth:

Amending my answer with with what I think is a complete solution:

I was able to eliminate all the Metal-related “nullable” errors and build the dev-ar-kit branch successfully by using XCode 9 beta 2, which is still available for download (as of the time I’m writing this) here:

Originally I downloaded XCode 9 beta 4, the latest version from Apple and the only one easily available on their website. But using beta 4 gave me the exact same errors mentioned here. (Beta 3 seems to cause the same problems.)

To successfully built the AR Sample project, I deleted XCode beta 4 and the old dev-ar-kit repo from my Mac, freshly downloaded and set up beta 2, and then got a new clone of dev-ar-kit and followed all the build instructions here:

https://github.com/EpicGames/UnrealEngine/tree/dev-ar-kit

Hope this helps. Leaving my previous answer below in case it’s helpful for other Mac / XCode newbies… but ultimately I got the same errors when trying to build AR Sample until I reverted to XCode 9 beta 2.

======================

[Previous answer]

I got a similar error (below) the first time I tried to build in XCode. However, I realized that I had just selected the ShaderCompilerWorker scheme file in the left column (the file browser) and then hit Command-B (Product > Build).

When I instead selected the scheme using Product > Scheme > ShaderCompilerWorker (per @Asmtechnology 's instructions) , then hit Command-B / Product > Build, the build succeeded.

Being an XCode n00b (usually use Windows), I didn’t know how to select a specific scheme for building. You have to use the Product menu as described above. You will know it’s right when you click into the Report Navigator and it says you’re building “ShaderCompileWorker” instead of “UE4”:

192926-screen+shot+2017-07-31+at+7.01.27+pm.png

Hope this helps. Here’s the error I originally got:

Showing Recent Issues ERROR: UBT
ERROR: Failed to produce item:
/Users/bryanc/Downloads/UnrealEngine-dev-ar-kit/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-MetalRHI.dylib

I’m following the instructions to compile UE4 through Xcode and set up the ar-kit plugin, listed here:
https://github.com/EpicGames/UnrealEngine/tree/dev-ar-kit

But after trying to build (for profiling) the ARSample scheme, I’m getting the following error:

ERROR: UBT ERROR: Failed to produce
item:
UnrealEngine-dev-ar-kit/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-MetalRHI.dylib

Any ideas where I may have gone wrong here?

Thank you

change line 82 of MetalParallelRendererCommandEncoder.cpp to:

  • (nullable id )renderCommandEncoder

That property is declared as nullable, but the custom getter in line 82 implements it as nonnull by omitting the nullable keyword.

change line 82 of MetalParallelRendererCommandEncoder.cpp to:

  • (nullable id )renderCommandEncoder

That property is declared as nullable, but the custom getter in line 82 implements it as nonnull by omitting the nullable keyword.

Hello.

Do you really intend to profile a beta unreal engine with a beta version of Xcode , or do you simply want to try out the ARSample?

If it is the latter , use the “Build” command in Xcode to create a debug build. The command is located slightly below the “Build for…” command under the product menu.

Please let me know so that I can try and help in a meaningful way.

Regards.

Thank you!!

Unfortunately still producing the same errors.

I think this might have something to do with either my Mac or Model. It’s a new machine (2017 model) and there might just be too many levels of beta + new hardware in the mix.

Ideally it’s not my GPU, but that’s another issue.

Anyway, thank you so much for your help! I’m going to report this as a bug.