Developer Notes

Duplicate of UE-7578

Description

Add Code to Project fails to add a class to the project. The project can't be reopened until the classes are manually removed and the project is recompiled. The following errors occur when using Add Code to Project in a Blueprints project:

Failed to add class MyAIController. Failed to compile newly created game module.

From the Compiler Log:

Error D:/4.7_Projects/AddClassBug2/Source/AddClassBug2/MyAIController.h(11)  : Error: Superclass AIController of class MyAIController not found
Error Error: Failed to generate code for AddClassBug2Editor - error code: OtherCompilationError (2) 

Displayed on the Add Code window:

The name MyAIController is already used by another class.

When attempting this in a code project, the first error instead says:

Failed to add class MyActor. Failed to automatically hot reload the 'MyProject' module.

Note: other classes seem to work fine, but once the first class fails creation any other classes will also fail.

Reproduced in 4.7.2 binary and Main (//depot/UE4/Promotable-CL-2478413)

Steps to Reproduce

1. Open a new blank Blueprint project
2. File > Add Code to Project
3. Show All Classes > Search for AIController > Next
4. Use a unique name (MyAIController is fine) > Create Class

Results:

Failed to add class MyAIController. Failed to compile newly created game module.

From the Compiler Log:

Error D:/4.7_Projects/AddClassBug2/Source/AddClassBug2/MyAIController.h(11)  : Error: Superclass AIController of class MyAIController not found
Error Error: Failed to generate code for AddClassBug2Editor - error code: OtherCompilationError (2) 

Displayed on the Add Code window:

The name MyAIController is already used by another class.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Duplicate
ComponentUE - Foundation - Core
Affects Versions4.7.24.8
Target Fix4.8
CreatedMar 16, 2015
ResolvedMar 17, 2015
UpdatedFeb 5, 2017
View Jira Issue