Project crash and subsequent inability to open

Included crash info. Usually problem was caused after attempting to “hot reload” a file that compiled in visual studio but brought an error in UE4. Typically “out_of_range” in regards to something if I recall. Love to get a fix so I could actually get through a tutorial in under 3 projects.

MachineId:0B404E174BBDB5AAD4DB19A6C56E11A3
EpicAccountId:719670ebd1a34104a8deec979d00590d

Unknown exception - code 00000001 (first/second chance not available)

"Fatal error: [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.9\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 3036]
Default subobj

UE4Editor_Core!FDebug::AssertFailed() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\misc\outputdevice.cpp:354]
UE4Editor_CoreUObject!FObjectInitializer::CreateDefaultSubobject() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:3036]
UE4Editor_CoreUObject!UObject::CreateDefaultSubobject() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\obj.cpp:86]
UE4Editor_PawnPractice_4020!AMyPawn::AMyPawn() [c:\users\tobyl\documents\unreal projects\pawnpractice\source\pawnpractice\mypawn.cpp:25]
UE4Editor_CoreUObject!UClass::CreateDefaultObject() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\class.cpp:2657]
UE4Editor_CoreUObject!UObjectLoadAllCompiledInDefaultProperties() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:729]
UE4Editor_CoreUObject!ProcessNewlyLoadedUObjects() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:815]
UE4Editor_CoreUObject!TBaseStaticDelegateInstance::ExecuteIfSafe() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:921]
UE4Editor_Core!TBaseMulticastDelegate::Broadcast() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:809]
UE4Editor_Core!FModuleManager::LoadModuleWithFailureReason() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\modules\modulemanager.cpp:426]
UE4Editor_Projects!FModuleDescriptor::LoadModulesForPhase() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\projects\private\moduledescriptor.cpp:370]
UE4Editor_Projects!FProjectManager::LoadModulesForProject() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\projects\private\projectmanager.cpp:53]
UE4Editor!FEngineLoop::LoadStartupModules() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\launchengineloop.cpp:1989]
UE4Editor!FEngineLoop::PreInit() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\launchengineloop.cpp:1495]
UE4Editor!GuardedMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\launch.cpp:110]
UE4Editor!GuardedMainWrapper() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]

// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don’t need it.
PrimaryActorTick.bCanEverTick = true;

	//Set pawn to be controlled by lowest-numbered player
	AutoPossessPlayer = EAutoReceiveInput::Player0;

	//Create dummy root component we can attach things to.
	RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent"));

	//Create visible component
	OurVisibleComponet = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("OurVisibleComponent"));

	//Attach camera and visible component to Root. Offset and rotate camera
	OurVisibleComponet->AttachTo(RootComponent);

	SphereComponent = CreateDefaultSubobject<USphereComponent>(TEXT("RootComponent"));
	SphereComponent->AttachTo(RootComponent);
	SphereComponent->InitSphereRadius(40.0f);
	SphereComponent->SetCollisionProfileName(TEXT("Pawn"));

	// Create a particle system that we can activate or deactivate
	OurParticleSystem = CreateDefaultSubobject<UParticleSystemComponent>(TEXT("MovementParticles"));
	OurParticleSystem->AttachTo(OurVisibleComponet);
	OurParticleSystem->bAutoActivate = false;
	OurParticleSystem->SetRelativeLocation(FVector(-20.0f, 0.0f, 20.0f));
	//static ConstructorHelpers::FObjectFinder<UParticleSystem> ParticleAsset(TEXT("/Game/StarterContent/Particles/P_Fire.P_Fire"));
	//if (ParticleAsset.Succeeded())
	//{
	//	OurParticleSystem->SetTemplate(ParticleAsset.Object);
	//}


	SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraAttachmentArm"));
    SpringArm->AttachTo(RootComponent);
    SpringArm->RelativeRotation = FRotator(-45.f, 0.f, 0.f);
    SpringArm->TargetArmLength = 400.0f;
    SpringArm->bEnableCameraLag = true;
    SpringArm->CameraLagSpeed = 3.0f;

	Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("ActualCamera"));
	Camera->AttachTo(SpringArm, USpringArmComponent::SocketName);

As you can see…I pretty much just followed: Components and Collision | Unreal Engine Documentation
tutorial. I have tried exactly copying the code and I get the same error. I made the changes I did as it seemed to mildly postpone the crash (I have about 3 projects with trying to do this tutorial. Each has the same crash error)

Hey Assassin33-

Looking at the callstack it seems that something in the construction script of AMyPawn is causing the issue. Can you post the code in the constructor of this class for more information? Additionally, does the project compile successfully in Visual Studio or does it give a compile error?

Cheers

I recall it compiling perfectly in Visual Studio but when it loaded into UE4 the project crashed. I’ve tried moving the project folder and deleting the derived data cache, to no avail.

Changed the line, recompiled in Visual studio and tada. Everything survived. Thank you very much. As the crash wasn’t very informative may I suggest that some sort of…handling of this for future versions. I’m thinking of others mostly.
Thank you again.

There are two lines of conflicting code. The line that begins with RootComponent = and the line that begins with SphereComponent = both have “RootComponent” inside the TEXT() macro. This string is the friendly name for the component which must be unique. Both components sharing the same friendly name is what is causing the conflict. If you change the text inside either one to another name it should solve your issue.

Cheers