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"

Can't Package and cook the game version 4.11.2

Hi, I can't package the game for deploy, I attached the log file . It seems to be a Critical error: Fatal error: [File:D:\BuildFarm\buildmachine_++UE4+Release-4.11\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp] [Line: 83] SECURE CRT: Invalid parameter detected. Expression: Unknown Function: Unknown. File: Unknown Line: 0

I am really disappointed I worked so hard and just can't publish the project, how can I do this from visual studio or at least to where can I search to remove te problem recompile the engine etc a work around something.

link text

Product Version: UE 4.11
Tags:
more ▼

asked Apr 21 '16 at 03:35 PM in Packaging & Deployment

avatar image

Ion Cocarcea
125 8 10 14

avatar image Spectral Ink Apr 23 '16 at 06:58 AM

I'm having a similar issue. Game packages in 4.11.1 and all previous builds, now I can't get anything to compile on Android since the hotfix

avatar image Matthew J May 03 '16 at 09:31 PM

Hello everyone, I apologize for the delay but I would like to attempt to get to the bottom of the issue. Is anyone still experiencing these problems? If so, does Ion's fix below at least temporarily work for you? Also, just in case there have been any changes or in the event that there may be different errors occurring here, can each of you that are having this issue post your own logs from when it fails?

In your projects, are they blueprint only projects or do they also have code in them? Have you experienced this issue with any other projects? Was the project that this is occurring in converted from a previous version of the engine such as 4.10? As much information as you can give would be helpful.

avatar image Ion Cocarcea May 04 '16 at 07:35 AM

Hi Matthew, It is ok just let's try to solve this. The problem is still there, on last project I used only blueprints, and also Substance Materials from PBR substance pack. Files in dropbox the upload from forum seems to have problems, it says file is to small or no file. Here is the output log and the log from cook: https://www.dropbox.com/sh/4exzunlsu0egyc1/AADEuIXEtqjFmHW3jaDtTCTea?dl=0

avatar image Ion Cocarcea May 04 '16 at 07:35 AM

Also if you don't see from logs I can upload full project maybe that way will be easyer for you.

avatar image Matthew J May 05 '16 at 04:37 PM

That would be helpful. It would let me see the project settings you're using and also allow me to see if the issue will reproduce on my machine. If you would need to keep it private for any reason you can feel free to provide the download link via a private message on our forums.

avatar image Spectral Ink May 04 '16 at 07:45 AM

Hi Matthew, thanks for getting on this. My issue seemed to magically resolve itself after about a week. One day it wasn't working, next day it was. I was having problems stated on this thread - https://answers.unrealengine.com/questions/213886/cant-launch-and-build-for-android.html

avatar image Stormwind May 13 '16 at 06:20 PM

We are experiencing the same type of data cook failure related to a different plugin. Full clean builds do not resolve the issue for is.

avatar image Matthew J May 13 '16 at 06:26 PM

What plugin is it that is causing problems? Does the issue go away if the plugin is temporarily disabled? Did you use this plugin in this project prior to 4.11.2 and if so, did you get a newer version of the plugin to go along with the engine upgrade? I'm still in the process of trying to gather more information.

avatar image Stormwind May 13 '16 at 06:45 PM

InstaLOD plugin. I'm in communication with the plugin developer as we try to diagnose/debug it. Yes, the problem only occurs when the plugin is enabled.

The plugin itself is build from source code (so goes along with 4.11.2) and uses a pre-build DLL file. The error only occurs in the Windows data cook - the Mac data cook succeeded.

Here is the command line used:

 Engine/Build/BatchFiles/RunUAT.bat BuildCookRun -server -project=G:\windows-slave-1\game-build-windows\build\UnrealEngine4\GameProject\Descent.uproject -noP4 -platform=Win64 -serverplatform=Win64 -clientconfig=Shipping -serverconfig=Shipping -cook -allmaps -stage -pak -archive -archivedirectory=G:\windows-slave-1\game-build-windows\output -utf8output -buildmachine

Here is the output log snippet of the failure: http://pastebin.com/4mBHQfLG

avatar image its_manny May 14 '16 at 06:53 PM

I have been able to build a project that fails during cook. This bug is actually unrelated to InstaLOD or its mesh reduction, and I guess this bug is the reason other plugins seem to crash during cook at random:

As soon as a module invokes printf or cout it crashes, no matter what type of string is sent to the standard io. It just crashes, even if it is the first line of code that is executed inside the module. And I am pretty sure this is the reason why other plugins like the substance plugin crashes for some users and not for others, because stdio output might vary based on what substance is being processed.

This is also the reason why it doesn’t crash on mac or linux, because only on windows the secure crt exists. There must be a bug within UE4 that only happens when running UE4 from the commandline. UE4 is probably only using the secure CRT in certain cases, like when building for shipping via terminal and unfortunately the CRT is not setup correctly.

You can get more infos about InstaLOD at www.instaLOD.io . InstaLOD is a 3D optimization plugin and provides features to automatically optimize 3D models, generate LOD, perform draw call reductions and more.

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

9 answers: sort voted first

Hi guys, it seem the problem is solved after it got in my mind to disable some plugins, So I disabled all that are beta alpha and also others that I don't need for example android my app is windows only. And it seems that resolved the problem for this project and also for other projects I have. Don't know yet maybe Mathew will find something more about this, but you can try to do my way until then :), maybe it will work for you to.

more ▼

answered May 08 '16 at 04:34 PM

avatar image

Ion Cocarcea
125 8 10 14

avatar image GPM May 10 '16 at 10:44 PM

Thanks for this answer, I didn't get a chance to work on getting my own project to build until today and tried this fix out. I have two plugins installed but I'm not using either much so I just disabled them both.

Builds now work perfectly!

The two plugins I turned off were Substance and Modo if anyone needs to know.

avatar image Ion Cocarcea May 11 '16 at 08:30 AM

Substance has no problem, I work a lot with it, and the projects were with substance enabled.

avatar image gbrill Dec 19 '16 at 04:46 PM

While a possible workaround, this doesn't provide an answer. I think I have found a more general answer and solution...see the bottom of this thread and, meanwhile, yell at the publisher of the offending plugin and say, "you need to compile that with /MT and NOT /MD so it statically links to the MSVC runtime"...see more in my comment later.

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

I spent a solid week working on finding this...very subtle and terrible thing but I found at least one way you can get this error when packaging and one way to solve it. Here is hoping these saves others the time sink in hunting this down.

This error can be 100% unrelated to your code in Unreal and 100% due to a binary dll a thirdparty gives you (or you write yourself as in my case...if I hadn't been in control of the offending DLL I never would have been able to resolve this). But any dependent windows dll can cause this issue.

In short, if your project is using a binary DLL for Windows AND that DLL was created by liking to the multithreaded DLL runtime library for MSVC (/MD, this is the default BTW), you may get this error when packaging a project that uses that DLL. The fix for this is to compile the binary with the /MT flag so that it links statically with the msvc runtime and is not dependent on the MSVC runtime DLLs.

This issue will not manifest itself in an Development Editor build/run, but will only appear when packaging your windows application. I didn't go deeply into the specifics of what is going on with the packager (talk about not documented), but it is likely that the package process rebuilds your project with flags that complicate the linkage and compromise the loading of that dll from the project's exe host...and you get that error as a result. The packager actually attempts to load and run your dll (to test it maybe?) and when it does so...very bad things. I traced things with "Process Monitor/procmon.exe" (if you don't know this utility, get to know it) and you can see werfault.exe get called, that's the windows segfault reporter..so something got kernel-murdered when it tries to load the dll...

I fixed it by recompiling the DLL with /MT instead of /MD. Now, all good...packages happily.

But this pathology kind of fits with issues others are experiencing...the fact that some plugins need to be disabled to package the game makes me think 1) these plugins are for editor use and were compiled by the developed with the /MD option because that is the default in visual studio and what the publisher used 2) that setting works fine Editor builds and 3) these plugins were never intended to be packaged with the game (and the developers never attempted to do that so were unaware of the issue).

Anyway, probably not the only reason this error occurs, but definitely one possible reason and certainly the issue I was having. Epic would do well to attempt the load dll in a seperate commandlet so that an exception would not tear down the process and would give them an opportunity to log what is going on. Had such a hypothetical log said "attempting to load dll..." and then "oh no, dll failed load, did you check to make sure you used the right build options?" I would be a week further in my development life...

more ▼

answered Dec 19 '16 at 04:40 PM

avatar image

gbrill
131 5 8 14

avatar image Rama Dec 20 '16 at 12:47 AM

Wow that's awesome find gbrill! Thank you for sharing!

Rama

avatar image Malloc007 Mar 30 '17 at 02:44 AM

Hello Rama,i am according to your https://wiki.unrealengine.com/Linking_Static_Libraries_Using_The_Build_System the tutorial Express set the Third party lib RunTimeLibrary MD..

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

Just last night, It seems I resolved the problem creating a blank code file and also deleted intermediate and saved folder from game project, then everything worked normal.

more ▼

answered Apr 23 '16 at 09:59 AM

avatar image

Ion Cocarcea
125 8 10 14

avatar image Spectral Ink Apr 23 '16 at 09:02 PM

didn't work for me. I'm working on a blueprint project. Good thought, but deleting the saved and intermediate folder didn't resolve the problem for me

avatar image GPM Apr 26 '16 at 03:28 PM

Unfortunately I have the same issue but deleting the saved & intermediate doesn't seem to solve it. I might try and create a blank C++ file for a temp fix but is there any specific way you are doing this? Through the editor or through VS?

avatar image Ion Cocarcea Apr 26 '16 at 04:05 PM

I deleted the saved and intermediate from windows explorer, bu first I made the c++ file then recompiled the project from VS. But for next project it does not work, it seems there is still something happening.

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

I am having exact same error message, but I cant fix mine no matter what I do. Also I have tried with a blank project :(

This must be a issue on 4.11.2 as a few others posted the same error message.

more ▼

answered Apr 23 '16 at 09:25 PM

avatar image

johnpre
6 2 3 7

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

It seems the problem persists, today I created a new project and had the same problem, but once again did the steps above and it's solved. It is obvious there is a problem on project compiler.

more ▼

answered Apr 23 '16 at 09:05 PM

avatar image

Ion Cocarcea
125 8 10 14

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

This still exists in 4.14, no plugins apart my C++ code. Everything works in standalone. Some more info about the problem in error message instead undefined undefined undefined would be nice. Thanks.

The problem was in my Actor constructor, I started a thread there via singleton which apparently is forbidden, which actually is very good approach. Mea culpa. Moved code to BeginPlay and now everything packages as a charm. By the way, Editor indeed thrown that problem too but at that stage it was just a warning, so check out your logs.

Anyway a stack trace in the error message would be useful :)

more ▼

answered Dec 12 '16 at 03:37 PM

avatar image

slaj
1 1 1

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

For completeness sake I've found the actual cause of this, it's trivial but was a pain to find.

As already mentioned, you can disable the CRT checks but you will lose the code that will check for any malformed strings. The real problem is caused by UE forcing stdout to UTF-8, when packaging, I'm not sure why this is needed.

When stdout is set to UTF-8, you can't use printf or std::cout, it will fail this check _VALIDATE_STREAM_ANSI_RETURN.

The correct fix would be to replace printf / std::cout with wprintf / std::wcout, you can change any %s instanced in your printf calls to %hs to avoid having to change more code than needed. If it's a third-party supplied dll/lib, it might be worth relaying the information.

more ▼

answered Feb 27 '17 at 10:48 AM

avatar image

Paul.Tankard
1 1

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

Thanks for finding this, it is super interesting to know...it may have a little to do with what I was saying earlier about that static vs dynamical liking of the common runtime which is one solution to this issue (though I appreciate not everyone has the opportunity to rebuild their third party libraries).

I can imagine the presence of printf/cout requiring linking with a function in a C runtime dynamic library that triggers this check, hence the error. But if the third party library/DLL we are trying to use links statically with the C runtime libraries, perhaps, the error check isn't necessary: after all, in that case, we are not asking Unreal to link with the offending library and provide it with necessary runtime functions as is the case with dynamic linking/dlls...in the case where you build your thirdparty library with a static link to the c/runtime and create a DLL then Unreal packager no longer has that responsibility.

Or not. I dunno.

more ▼

answered Feb 27 '17 at 02:22 PM

avatar image

gbrill
131 5 8 14

avatar image Paul.Tankard Feb 27 '17 at 02:40 PM

Interestingly enough (I posted this initially on UDN) why InvalidParameterHandler gets NULL replies back from the offending code is a mystery, it wasn't until I isolated the code and got valid data I knew what was happening. I'm not sure with the static/dynamic linking, one would have CRT checking (depending on CRT checking enabled or not) enabled and one wouldn't so hides the issue rather than fixes it.

printf can print full character ranges 0-255 (I think) therefore it would be a problem for a UTF-8 code page as I don't think there's any translation for it. So you could still get errors along the way depending on what is being printed, time of day, whether you had breakfast etc. :)

But, a sample rig is thus.

 #include <stdio.h>
 #include <tchar.h>
 #include <stdlib.h>  
 #include <fcntl.h>
 #include <io.h>
 
 void InvalidParameterHandler(
     wchar_t const* Expression,
     wchar_t const* Function,
     wchar_t const* File,
     unsigned int Line,
     uintptr_t Reserved)
 {
     __asm int 3;
 }
 
 int main()
 {
     _set_invalid_parameter_handler(InvalidParameterHandler);
     _setmode(_fileno(stdout), _O_U8TEXT);    // UE4 sets this when packaging via the editor or UFE by setting -utf8output.
 
     _tprintf(_T("might work\n"));            // won't work if compiled as multi-byte, will if compiled as UNICODE.
     wprintf(L"works\n");
     printf("doesn't work\n");
     return 0;
 }

avatar image gbrill Feb 27 '17 at 02:59 PM

Hmm. Well, this all seems to jive to me...and you are likely correct that the mere presence of these function calls is likely bad mojo...I think in the ideal case no one should have printf/cout code living in a module, unicode or not...but of course during the development of the module or library, we all do it...I think this is a big argument to devs of all stripes, plugin or straight-unreal: preprocess out your logging stuff.

Of course, I like to remap stdout/err handles to UE_LOG.. So I guess, in that case, make sure we are dealing with TCHAR...ANSI=bad news.

Thanks again for looking into this...I started on the path, but lacked the endurance once I found a "fix". But now the issue actually makes sense...

avatar image Paul.Tankard Feb 27 '17 at 03:08 PM

No problem, I had to find the issue, as it was a third party lib linked in to a module causing the problem, luckily we were able to modify the source locally to fix it, but with other 3rd party libraries it may require contacting the vendor to supply a fix.

avatar image Malloc007 Mar 30 '17 at 07:00 AM

I just tried it,printf UE_LOG are Noted,The Packet success!!

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

Thank you all for your suggestions and solutions, will try on 4.14.3 tomorrow morning, wil return with confirmation if it worked. If we work together we'll find a solution for almost everything :). I use substance plugin and sometimes Dungeon Architect from plugins and I think at least substance is reliable and works well on other engines like unity .

more ▼

answered Feb 27 '17 at 02:31 PM

avatar image

Ion Cocarcea
125 8 10 14

(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