Project Crashes on loading the project

I am currently working on a FPS game.When i added a c++ class of type BTTask_BlackboardBase, the message log said
“New Class added to the project but hot reload failed.”
When i saw the message log, the error was :
“error LNK2001: unresolved external symbol “public: virtual void __cdecl IGameplayTaskOwnerInterface::OnGameplayTaskActivated(class UGameplayTask &)” (?OnGameplayTaskActivated@IGameplayTaskOwnerInterface@@UEAAXAEAVUGameplayTask@@@Z)”

i fixed this by adding the “GameplayTasks” string in the public dependencies in build.cs file
Then i wrote the following code in the class

BTTask_FindPointNearEnemy.h:

#include “CoreMinimal.h”
#include
#include
#include “BTTask_FindPointNearEnemy.generated.h”

/**
*
*/
UCLASS()
class LONESURVIVOR_API UBTTask_FindPointNearEnemy : public UBTTask_BlackboardBase
{
GENERATED_BODY()

virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent* OwnerComp, uint8* NodeMemory) override;	

};

BTTask_FindPointNearEnemy.cpp:

#include “LoneSurvivor.h”
#include “BTTask_FindPointNearEnemy.h”
#include “ZombieAIController.h”
#include “LoneSurvivorCharacter.h”
#include “LoneSurvivorZombies.h”
#include “BehaviorTree/BehaviorTreeComponent.h”
#include “BehaviorTree/BlackboardComponent.h”
#include “BehaviorTree/Blackboard/BlackboardKeyAllTypes.h”

UBTTask_FindPointNearEnemy::UBTTask_FindPointNearEnemy(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}

EBTNodeResult::Type UBTTask_FindPointNearEnemy::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
AZombieAIController* ZombieController = Cast(OwnerComp.GetAIOwner());
if (ZombieController == NULL)
{
return EBTNodeResult::Failed;
}

APawn* Zombie = ZombieController->GetPawn();
ALoneSurvivorCharacter* Enemy = ZombieController->GetEnemy();
if (Enemy && Zombie)
{
	const float SearchRadius = 200.0f;
	const FVector SearchOrigin = Enemy->GetActorLocation() + 600.0f * (Zombie->GetActorLocation() - Enemy->GetActorLocation()).GetSafeNormal();
	FVector Loc(0);
	UNavigationSystem::K2_GetRandomReachablePointInRadius(ZombieController, SearchOrigin, Loc, SearchRadius);
	if (Loc != FVector::ZeroVector)
	{
		OwnerComp.GetBlackboardComponent()->SetValue<UBlackboardKeyType_Vector>(BlackboardKey.GetSelectedKeyID(), Loc);
		return EBTNodeResult::Succeeded;
	}
}

return EBTNodeResult::Failed;

}

After writing this code, when i started the hot reload, the unreal editor crashed and generated a crash report:
Fatal error: [File:D:\Build++UE4+Release-4.17+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 2474] UObject(const FObjectInitializer&) constructor called but it’s not the object that’s currently being constructed with NewObject. Maybe you trying to construct it on the stack which is not supported.

UE4Editor_Core!FDebug::AssertFailed() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:349]
UE4Editor_CoreUObject!UObject::UObject() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:2475]
UE4Editor_AIModule!UBTNode::UBTNode() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\aimodule\private\behaviortree\btnode.cpp:14]
UE4Editor_AIModule!UBTTaskNode::UBTTaskNode() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\aimodule\private\behaviortree\bttasknode.cpp:8]
UE4Editor_AIModule!UBTTask_BlackboardBase::UBTTask_BlackboardBase() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\aimodule\private\behaviortree\tasks\bttask_blackboardbase.cpp:5]
UE4Editor_LoneSurvivor_5270!UBTTask_FindPointNearEnemy::UBTTask_FindPointNearEnemy() [e:\projects\unreal projects\lonesurvivor\source\lonesurvivor\bttask_findpointnearenemy.cpp:14]
UE4Editor_CoreUObject!UClass::CreateDefaultObject() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:2687]
UE4Editor_CoreUObject!UObjectLoadAllCompiledInDefaultProperties() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:817]
UE4Editor_CoreUObject!ProcessNewlyLoadedUObjects() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:895]
UE4Editor_CoreUObject!TBaseStaticDelegateInstance::ExecuteIfSafe() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:1027]
UE4Editor_Core!TBaseMulticastDelegate::Broadcast() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:937]
UE4Editor_Core!FModuleManager::LoadModuleWithFailureReason() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\core\private\modules\modulemanager.cpp:487]
UE4Editor_Projects!FModuleDescriptor::LoadModulesForPhase() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\projects\private\moduledescriptor.cpp:476]
UE4Editor_Projects!FProjectManager::LoadModulesForProject() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\projects\private\projectmanager.cpp:69]
UE4Editor!FEngineLoop::LoadStartupModules() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2543]
UE4Editor!FEngineLoop::PreInit() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:1957]
UE4Editor!GuardedMain() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\launch.cpp:127]
UE4Editor!GuardedMainWrapper() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UE4Editor!WinMain() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
kernel32
ntdll

Aftter that, whenever i try to reopen the project, it initialises upto 71% and then crashes with the same error report.
I have also tried debugging the game using visual studio that didn’t help either.

Does anyone know how to resolve this?