After the upgrade from 4.11 to 4.12.5, packaging or generating project files cause the following error to be displayed:
ERROR: Unable to determine module type for D:\...\Source\<ProjectName>\<ProjectName>.Build.cs
The project sets the “module type” in D:…\Source\ ProjectName .Target.cs like this:
public class ProjectNameTarget : TargetRules
{
public ProjectNameTarget(TargetInfo Target)
{
Type = TargetType.Game;
// Ensure that we compile with the Steam OSS
UEBuildConfiguration.bCompileSteamOSS = true;
}...
The code originally came from the doc here: Build Target. UBT appears to be ignoring the Type assignment. The code worked in 4.11. The 4.12 Release Notes mention some changes to UBT and Targets but nothing about changing the module type assignment in code. Should the Type assignment in the target code be updated to something new? Is this related to changing the VS default from 2013 to 2015?
Another user’s question that has a similar error message is: No engine version
I’ve been working on it full time for 3 days. The issue seems to be inside Engine\Binaries\DotNET\UnrealBuildTool.exe, even running this from the command line with -verbose only produces the error and no more. I’m going to be AFK for a couple hrs, but will start looking through the source after that. I’ll post here if I find any thing useful.
i found a solution and i hope this will help you aswell. i made a new C++ project with exact the same name as my working-project. then i created the .vs files. opend vs and started the game. now that all files are created, i deleted the binaries, intermediate, build and save folder from my working-project. then i copied all that folders, the exe and vs + source files from the new project into my working-project. i was able to launch it and package the game. hope this helps you too my brother in suffering
I tried your method and it worked. In my first try, I copied over all of the files/directories (or so I thought) and it didn’t work. The magic one was replacing ProjectName.uproject. I copied that over, did a ‘generate project files’, opened the project in 4.12 and the packaging worked. Many, many thanks! I’ll mark your reply as the answer.
Quick testing shows that the “EngineAssociation” is not necessary for generating project files and only the “Modules” section (makes sense).
So, potential quicker fix should be to add the “Modules” section to your .uproject once you have all the necessary C# and C++ stubs in place (which is probably most easily done by making a new empty project?).
Another possible cause of this is having a second .uproject file in a directory. We downloaded a package from the store that had its own project file for demo purposes, but this really confused UBT and made our app give this “Unable to determine module type” error. Deleting the second .uproject file fixed it for us.
I solved this after a while by removing the generated c++ files needed from some tutorial. The tutorial needed a simple c++ file and I generated one and called it MyClass. I guess it as from previous version of UE and when migrating to version I guess it came with it which could be the cause of the issue. I personally do not need it anymore so I deleted the class and all other files in {youproject}/Source/… In mine there were only a couple of files. Started a “package project” and it is building now. I do not know why exactly but I guess when those files are there some other file needs to be in place which was not ported from older project… or something similar It works now…
I solved this after a while by removing the generated c++ files needed from some tutorial. The tutorial needed a simple c++ file and I generated one and called it MyClass. I guess it as from previous version of UE and when migrating to version I guess it came with it which could be the cause of the issue. I personally do not need it anymore as the project I try to build is a Blueprint only project, so I deleted the class and all other files in {youproject}/Source/… In mine there were only a couple of files. Started a “package project” and it is building now. I do not know why exactly but I guess when those files are there some other file needs to be in place which was not ported from older project… or something similar It works now…
I also followed a tutorial and I had to create a C++ file; Now I can’t build my game because my Visual Studio doesn’t works. So, I did that you said (delete the content of /Source/ folder) and it’s now building correctly. You saved my project! Well, I wasn’t going to destroy my project because I had an 1 month-ago backup, but you saved to me a lot of time!