Default subobject exists

I have a problem , after building my project, when I try to launch it in the editor, it crashes and an error is shown:

Fatal error: [File:D:\Build\++UE4+Release-4.12+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 3418] 
Default subobject CameraComponent Text already exists for KeypadBase /Script/Project.Default__KeypadBase.

This, I think , Is connected to another error: I need about 3 rebuilds and 2 crashes for new code (for example UPROPERTY added to class) to show in Editor. It seems like rebuilding project creates new files without deleting old ones and editor tries to load both of them (?). I tried cleaning it, does anyone knows what else can I do?

I’m using 4.15.3 and getting this same error. I tried creating some child actors in a subclass I made. I ended up crashing the editor for this very reason. I think it was because I accidentally used the same name on two of the child actors. I tried renaming them and rebuilding, but the editor still wont open. It keeps giving me the same error. I removed the subclasses and any BP associated with them from my code and my project, but the editor still will not open. I’m not entirely sure whats going on or how to fix it either. I’m kind of in the same boat here.

After messing around with my project, I finally got it to open in the editor again by deleting the contents of the “Intermediate” folder and then regenerating the visual studio project files. (right click on the Unreal Engine Project File > Generate Visual Studio project files. Don’t forget to rebuild your solution in visual studio afterwards).

Be sure to back up the contents in your Config file before trying this or you may lose all your editor settings. (DefaultEngine.ini & DefaultInput.ini)


You can add this comment as an answer and mark it as resolved.

This happened to me when I copied one mesh to create a new mesh and forgot to rename the DefaultSubObject as shown below:

HandMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Mesh"));
ArmMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Mesh"));

Once I made their names unique, everything worked:

HandMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Hand Mesh"));
ArmMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Arm Mesh"));

Simple after seeing the issue but not apparent at first because the project compiles fine.