Error when add new class from editor

When i try add new class i get error


Running C:/Program Files (x86)/Epic Games/4.12/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="C:/Users/CyberKatana/Documents/Work/Royale/RoyaleShooter.uproject" -game -rocket -progress
Discovering modules, targets and source code for project...
LogHotReload: Recompiling module RoyaleShooter...
LogVSAccessor:Warning: Couldn't access Visual Studio
Recompiling RoyaleShooter...
Launching UnrealBuildTool... [C:/Program Files (x86)/Epic Games/4.12/Engine/Binaries/DotNET/UnrealBuildTool.exe RoyaleShooter -ModuleWithSuffix RoyaleShooter 6251 Win64 Development -editorrecompile -FailIfGeneratedCodeChanges -canskiplink "C:/Users/CyberKatana/Documents/Work/Royale/RoyaleShooter.uproject"  -2015]
Creating makefile for hot reloading RoyaleShooter (no existing makefile)
Compiling game modules for hot reload
Performing full C++ include scan (no include cache file)
Parsing headers for RoyaleShooterEditor
  Running UnrealHeaderTool "C:\Users\CyberKatana\Documents\Work\Royale\RoyaleShooter.uproject" "C:\Users\CyberKatana\Documents\Work\Royale\Intermediate\Build\Win64\RoyaleShooterEditor\Development\RoyaleShooterEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed -FailIfGeneratedCodeChanges
ERROR: 'C:/Users/CyberKatana/Documents/Work/Royale/Intermediate/Build/Win64/UE4Editor/Inc/RoyaleShooter/MyBlueprintFunctionLibrary.generated.h': Changes to generated code are not allowed - conflicts written to 'C:/Users/CyberKatana/Documents/Work/Royale/Intermediate/Build/Win64/UE4Editor/Inc/RoyaleShooter/MyBlueprintFunctionLibrary.generated.h.conflict'
Error: Failed to generate code for RoyaleShooterEditor - error code: OtherCompilationError (5)
UnrealHeaderTool failed for target 'RoyaleShooterEditor' (platform: Win64, module info: C:\Users\CyberKatana\Documents\Work\Royale\Intermediate\Build\Win64\RoyaleShooterEditor\Development\RoyaleShooterEditor.uhtmanifest).
CompilerResultsLog: New page: Compilation - Aug 8, 2016, 1:32:55 AM
CompilerResultsLog: Info Creating makefile for hot reloading RoyaleShooter (no existing makefile)
CompilerResultsLog: Info Compiling game modules for hot reload
CompilerResultsLog: Info Performing full C++ include scan (no include cache file)
CompilerResultsLog: Info Parsing headers for RoyaleShooterEditor
CompilerResultsLog: Info   Running UnrealHeaderTool "C:\Users\CyberKatana\Documents\Work\Royale\RoyaleShooter.uproject" "C:\Users\CyberKatana\Documents\Work\Royale\Intermediate\Build\Win64\RoyaleShooterEditor\Development\RoyaleShooterEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed -F
ailIfGeneratedCodeChanges
CompilerResultsLog: Info ERROR: 'C:/Users/CyberKatana/Documents/Work/Royale/Intermediate/Build/Win64/UE4Editor/Inc/RoyaleShooter/MyBlueprintFunctionLibrary.generated.h': Changes to generated code are not allowed - conflicts written to 'C:/Users/CyberKatana/Documents/Work/Royale/Intermediate/Build/Win64/UE4Editor/Inc/RoyaleShooter/MyBlueprintFunctionLibrary.g
enerated.h.conflict'
CompilerResultsLog:Error: Error Error: Failed to generate code for RoyaleShooterEditor - error code: OtherCompilationError (5) 
CompilerResultsLog: Info UnrealHeaderTool failed for target 'RoyaleShooterEditor' (platform: Win64, module info: C:\Users\CyberKatana\Documents\Work\Royale\Intermediate\Build\Win64\RoyaleShooterEditor\Development\RoyaleShooterEditor.uhtmanifest).
LogMainFrame: MainFrame: Module compiling took 6.462 seconds

After that i deleted folders: Binaries, Intermediate, Saved.
And removed files of new class .h/.cpp from Source
Then RMB->Generate VS project files.
At last i run editor and tried again add new class and got same log

What im doing wrong?

All the required info is in the output:
Changes to generated code are not allowed -> MyBlueprintFunctionLibrary.generated.h

Sorry for undigging post but there are really no answers in the internet about this problem. I had the same problem and I want to write the solution.

This problem is related to some version control systems or engine itself. Sometimes for unknown reason or while crashing of CVS or Unreal itself the whole Project directory could be marked as Read Only. And this lead to this error.
So you need just to remove this mark from the project directory and for subfolders.

I had the same problem. Found a nice workaround in this video: https://youtu.be/TgJh4XpdOxU
Is in German, but you can understand the importent parts.

1 Like