Can't launch my project build: FilenameToLongPackageName failed to convert ''. The Result would be indistinguishable from using '' as the InFilename.

I’m trying to package my UE5 project into the standalone build, but every time I build and launch it, I face the same error:

Fatal error: [File:D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\Misc\PackageName.cpp] [Line: 771]
FilenameToLongPackageName failed to convert ‘’. The Result would be indistinguishable from using ‘’ as the InFilename.

Metter the fact that when I launch the game from the editor as a standalone game it works just perfectly.

I already tried:

  1. Deleting binaries, build, saved, intermediate and other temp folders - doesn’t help
  2. Moving project root into disk root to reduce path size - doesn’t help
  3. Fixing project’s folders redirections - doesn’t helped
  4. Checked gameplay tags - all good
    Also, when building I’m not receiving any errors, all clear.

I have already researched the whole internet and found only two posts regarding this error. One was fixed by removing symbols from gameplay tags (which is not my case) and the second one re-created the project in UE5 (which is not my case too bc project is initially created in UE5).

Any thoughts on what could I do to fix it? The situation seems quite desperate.

Could it be due to the project name itself? How long is the project name? Perhaps it is the part that is causing the problem (moving it to other directories in this case wouldn’t help).
There is normally a warning when you create a project with a too long name.

Just tried it and unfortunately, this does not help as well

Does you project name or any of its directories have any letters outside of the latin alphabet?
I’ve seen many project fail to compile because they had letters in different native languages.

Try running fix redirects in all folders.

You can try support long paths

Pretty sure that all characters in the project are latin alphabet. Support long paths are already turned on & Fix redirections on the whole content folder gives no effect

Have you looked into the saved directory for logs regarding the reason for failure?

At the end of

FString FPackageName::FilenameToLongPackageName(const FString& InFilename){
if (!TryConvertFilenameToLongPackageName(InFilename, Result, &FailureReason))
	{
/* contents of function*/
UE_LOG(LogPackageName, Fatal, TEXT("%s"), *FailureReason);
	}
	return Result;
}

So the function seems to log the more precise reason for the failure to the log file.

That’s what I can find in logs regarding error, not sure what is the reason

Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\Misc\PackageName.cpp] [Line: 771] 
FilenameToLongPackageName failed to convert ''. The Result would be indistinguishable from using '' as the InFilename.




0x00007ff6e629d0ab gtth.exe!FPackageName::FilenameToLongPackageName() []
0x00007ff6e62be364 gtth.exe!FPackagePath::TryFromMountedName() []
0x00007ff6e637a823 gtth.exe!UE::Serialization::GetLinkerLoadFromOwner() []
0x00007ff6e6380f43 gtth.exe!LoadPackageAsync() []
0x00007ff6ea381bf5 gtth.exe!UGameplayTagsManager::LoadGameplayTagTables() []
0x00007ff6ea380a96 gtth.exe!UGameplayTagsManager::InitializeManager() []
0x00007ff6eb6bf5bf gtth.exe!UEngine::InitializeObjectReferences() []
0x00007ff6eb6b924a gtth.exe!UEngine::Init() []
0x00007ff6eac76425 gtth.exe!UGameEngine::Init() []
0x00007ff6e46fc578 gtth.exe!FEngineLoop::Init() []
0x00007ff6e471910e gtth.exe!GuardedMain() []
0x00007ff6e47192ea gtth.exe!GuardedMainWrapper() []
0x00007ff6e471c36c gtth.exe!LaunchWindowsStartup() []
0x00007ff6e472db24 gtth.exe!WinMain() []
0x00007ff6ec89193a gtth.exe!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
0x00007ffc5f6a26bd KERNEL32.DLL!UnknownFunction []
0x00007ffc6056dfb8 ntdll.dll!UnknownFunction []

As a last ditch resort you could try building the engine from source, put a break point on the FilenameToLongPackageName() before package and see it trigger.
You would at least see the passed in parameters that could give you a hint why it’s failing.

1 Like

For everyone who is probably looking for salvation from this issue:

Thanks to @3dRaven advice - I’ve built UE5 from the source and after inspecting of TryConvertFilenameToLongPackageName method I’ve found that the issue was in some empty filename. I was unable to find what file exactly it was, but my solution was in adding a few simple lines of code to this method to skip file conversion if It’s empty, and now It works just fine and is building & packaging project without any issues as well.

1 Like

Please can you show me how you did it I have same problem with my project And thanks :pray:

I fixed this by just copying and pasting the intended directory into the “List of maps to include in a packaged build” field, because when you try to input it the normal way, it adds the …\ which unreal can’t read.
Worked for me after that.