Getting errors when packaging, "Couldn't save package, filename is too long"

So i decided to package my project to test some things to see if they would work in a packaged project but i have been running into some issues with the packaging process and would like it if someone could clarify some things for me.

As mentioned in the title i’m running into the error that the file names are too long, (PackagingResults:Error: Error Error Couldn’t save package, filename is too long:) i have been searching a bit and found that some people has been having some issues with the path name being too long (>165 characters) and i also found a post explaining that the names of the files need to be 32 characters or shorter.

But when i’m looking through the log i find paths that are much larger than the 165 that i found other people talking about. These two paths are 190+ characters long but they did not show any errors.

C:/Users/Joar Hedvall/Documents/Unreal Projects/Workspace_HomeInvasion/ProjectHomeInvasion/HomeInvasion/Saved/Cooked/WindowsNoEditor/HomeInvasion/Content/Chameleon/Materials/EdgeDetect3x3HLSL.uasset

C:/Users/Joar Hedvall/Documents/Unreal Projects/Workspace_HomeInvasion/ProjectHomeInvasion/HomeInvasion/Saved/Cooked/WindowsNoEditor/HomeInvasion/Content/EuropeanFurniture/Mesh/BedsideCabinet02.uasset

Also, i sometimes find file names such as these two which are under the 32 character limit but for some reason they produce an error that the file name is too long.

T_gravelTile_01A_D_R.uasset
SM_Vegetation_Debris_002.uasset

I would appreciate if someone could explain if there is a path character limit and what the limit is for the file names.


Here are some of the errors.

PackagingResults:Error: Error Error Couldn't save package, filename is too long: C:/Users/Joar Hedvall/Documents/Unreal Projects/Workspace_HomeInvasion/ProjectHomeInvasion/HomeInvasion/Saved/Cooked/WindowsNoEditor/HomeInvasion/Content/KiteDemo/Environments/Trees/Vegetation_Debris_002/SM_Vegetation_Debris_002.uasset

PackagingResults:Error: Error Error Couldn't save package, filename is too long: C:/Users/Joar Hedvall/Documents/Unreal Projects/Workspace_HomeInvasion/ProjectHomeInvasion/HomeInvasion/Saved/Cooked/WindowsNoEditor/Engine/Content/Functions/Engine_MaterialFunctions02/Texturing/ScreenAlignedPixelToPixelUVs.uasset

PackagingResults:Error: Error Error Couldn't save package, filename is too long: C:/Users/Joar Hedvall/Documents/Unreal Projects/Workspace_HomeInvasion/ProjectHomeInvasion/HomeInvasion/Saved/Cooked/WindowsNoEditor/HomeInvasion/Content/KiteDemo/Environments/Trees/ScotsPineTall_01/ScotsPineTall_01_Billboard_Mat.uasset

Hello ,

Through trial and error testing myself, it seems like the “final” character limit is 227. Anything 228 or higher will cause issues. The 165 limit you saw may be closer to what the file path needs to be prior to the packaging file path that is shown in the error log. If you compare the file path given in the Output Log to the actual file path in the file system, it adds 47 characters in the form of “Saved/Cooked/WindowsNoEditor/PackagingFileName/”.

If we assume that 227 is the limit, that would make the limit 180 prior to packaging. It also seems that “filename” will refer to the name of the file OR the path. In the case of your “SM_Vegetation_Debris_002.uasset”, the file path is still 230 which exceeds this limit.

Please let me know if you have any questions. I hope this helps!

Alright, i will have to do some restructuring and renaming. Thanks for the information. I’ll shoot you a message if i get any questions.

“Long Path Tool” is very helpful for this error !
best solution for your problem.

This solved my issue: Can someone from unreal explain cook failures? - Feedback for Unreal Engine team - Unreal Engine Forums my project folder from the default directory to C:\ directly made the path short enough for me to have this issue fixed.

i am still having issue with packaging my project. it is still giving me the issue of file name too long. can anyone help?

try this: Can someone from unreal explain cook failures? - Feedback for Unreal Engine team - Unreal Engine Forums

Thanks Glang. Worked for me!!

This was able to solve the issue for me!

Has anyone used LongPath Tool?