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. 

UBT ERROR: Failed to produce item, Unrealtype.h

I have a problem with Android packaging, The packaging works fine without plugin, but the plugin makes lots of errors ( I was able to package it before I reinstalled Windows). Using VS2015, CodeWorks1R7 (tried with 1R6-same problem, Windows SDK 8.1) All the errors are about UNREALTYPE.H Example of error:

In file included from Runtime/CoreUObject/Public/UObject/ScriptMacros.h:12: Runtime/CoreUObject/Public\UObject/UnrealType.h(3277,37): error: lambda capture 'LocalMapLayoutForCapture' is not used [-Werror,-Wunused-lambda-capture] [LocalKeyPropForCapture, KeyPtr, LocalMapLayoutForCapture](void* NewElementKey) Runtime/CoreUObject/Public\UObject/UnrealType.h(3290,41): error: lambda capture 'LocalMapLayoutForCapture' is not used [-Werror,-Wunused-lambda-capture] [LocalValuePropForCapture, ValuePtr, LocalMapLayoutForCapture](void* NewElementValue) Runtime/CoreUObject/Public\UObject/UnrealType.h(3786,47): error: lambda capture 'LocalSetLayoutForCapture' is not used [-Werror,-Wunused-lambda-capture] [LocalElementPropForCapture, ElementToAdd, LocalSetLayoutForCapture](void* NewElement)

full log attached

link text

Product Version: UE 4.16
log.txt (16.6 kB)
more ▼

asked May 02 '18 at 10:29 AM in Packaging & Deployment

avatar image

71 10 10 19

avatar image FilAl May 23 '18 at 01:32 PM


From the log you attached, i see that you are using NDK19. Am i mistaken? Please post a screenshot. Go to Editor, and there Edit->ProjectSettings->AndroidSDK. Make a screenshot please.

avatar image Deemk0 Jun 01 '18 at 08:01 AM

Yes, 19 were used. I ended up reinstalling Windows and the whole thing with it. Works as expected now :) Do you know what the problem was, so I can avoid it in the future?

avatar image FilAl Jun 03 '18 at 09:57 AM

Reinstalled Windows WTF!!!!!!!!!!!!!!!!!!

Aww those Epic d0r#s, what they make people to do. Ok. First of all Unreal build tool doesn't swallow NDK19 for several reasons, one of which being for example that Unreal uses PhysX3.4 of Nvidia as external library, and thus is pinned down to their Android configurations, which are NDK15 tops. If you managed to compile your thing with NDK19 u r awesome, and please post here the manual how.

Now, the reason for the error you posted is this:

In the very basic, lowest level include files of Unreal Engine there are several lambda expressions that capture more variables in the capture list, then used in actual expression body. This will compile and work. It's like, say, you are preparing for hiking trip, and took your favorite origami along. Not a big deal if you r careful.

Now, Android NDK compiles with rather uptight configuration. And this is veeery legit, since Android is meant to run on rather weak hardware. Look at IOS certification tests and compare if you like. It is configured on purpose to throw warning on gratuitous lambda captures. That's your hiking buddy legitimately warning you, that taking origami into a hiking trip might just be not the best idea for origami lifetime. Again, it's up to you. Legit? Yes.

Now, UBT (UnrealBuildTool) gives the compiler few more flags, one of which being f@#1ng -WarningsAsErrors ! It's hypothetical you deciding, that if your hiking buddy will have literally ANY complain or constructive critics about your gear, you will SHOOT YOURSELF IN THE HEAD! Rather harsh, isn't it?

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

1 answer: sort voted first

The solution will be next: Add next lines to the topmost header of your include hierarchy

 #pragma warning (push)
 #pragma warning (disable:4668) // 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives'. This is for Unreal to stop complaining, when u r not building 4 Android.
 #if defined( __clang__ ) && ( __clang_major__ < 6 )
 // clang-5 gives a spurious warning about not using the captured `ohandle`. Unreal uses NDK15, which falls into this category.
 #pragma clang diagnostic warning "-Wunused-lambda-capture" // Downgrade -Wunused-lambda-capture to warinig.
 #pragma clang diagnostic ignored "-Wunused-lambda-capture" // Ignore it.
 #pragma warning (pop)

Hopefully it'll solve. If u r getting the error still, complaining about YourProjectName.generated.cpp then u r screwed. Post here, and i will post a workaround, which is ugly, bad, but unfortunately the only way i found to pacify UHT(UnrealHeaderTool).


If u r not developing plugin, or can use Unreal locally, just go to UnrealType.h and fix the d@mn problem by commenting out the unused variables in the capture list. This will be right and gracious thing to do.

more ▼

answered Jun 03 '18 at 01:32 PM

avatar image

91 6 5

avatar image Deemk0 Jun 13 '18 at 08:18 AM

Thank you, I am definitely trying this next time I get same error in order to reinstall everything (:

(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