x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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

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

Product Version: UE Github Master branch
Tags:
more ▼

asked Jun 24 '17 at 09:06 PM in Packaging & Deployment

avatar image

nicksava
31 2 4 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

5 answers: sort voted first

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.

more ▼

answered Jun 26 '17 at 08:46 PM

avatar image

Asmtechnology
21 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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 :O

more ▼

answered Jun 30 '17 at 07:13 PM

avatar image

Bytecrew
23 1 2 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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:

https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_9_beta_2/Xcode_9_beta_2.xip

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":

alt text

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

more ▼

answered Jul 31 '17 at 11:03 PM

avatar image

monotoan
101 2 5 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Jun 26 '17 at 08:47 PM

avatar image

Asmtechnology
21 1 2

avatar image nicksava Jun 27 '17 at 03:26 AM

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!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Jun 27 '17 at 08:20 AM

avatar image

Asmtechnology
21 1 2

avatar image nicksava Jun 27 '17 at 08:37 PM

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 :)

avatar image Asmtechnology Jun 27 '17 at 09:16 PM

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,

avatar image nicksava Jun 28 '17 at 02:54 AM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question