Cant Package Project due to UnrealEd

Hello i tried to package my project to windows 64 bits but the output log shows me an error saying “UATHelper: Packaging (Windows (64-bit)): ERROR: Unable to instantiate module ‘UnrealEd’: Unable to instantiate UnrealEd module for non-editor targets.”, as the image bellow shows.

this is my .uproject file

{
	"FileVersion": 3,
	"EngineAssociation": "4.24",
	"Category": "",
	"Description": "",
	"Modules": [
		{
			"Name": "BotSurvivor",
			"Type": "Runtime",
			"LoadingPhase": "Default",
			"AdditionalDependencies": [
				"Engine",
				"UMG",
				"CoreUObject",
				"UnrealEd"
			]
		}
	],
	"Plugins": [
		{
			"Name": "Niagara",
			"Enabled": true
		}
	]
}

but if i remove that UnealEd dependecy now my USkinAssetFactory class i use to create own assets wont compile.

this the USkinAssetFactory,h

#pragma once

#include "CoreMinimal.h"
#include "Factories/Factory.h"
#include "SkinAssetFactory.generated.h"

/**
 * 
 */
UCLASS()
class BOTSURVIVOR_API USkinAssetFactory : public UFactory
{
	GENERATED_BODY()
	
public:
	USkinAssetFactory();

	// Begin UFactory Interface
	virtual UObject* FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
	// End UFactory Interface
};

and this is the USkinAssetFactory.cpp

#include "SkinAssetFactory.h"
#include "SkinData.h"

USkinAssetFactory::USkinAssetFactory()
{
	// Provide the factory with information about how to handle our asset
	bCreateNew = true;
	bEditAfterNew = true;
	SupportedClass = USkinData::StaticClass();
}

UObject* USkinAssetFactory::FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn)
{
	// Create and return a new instance of our MyCustomAsset object
	USkinData* SkinAsset = NewObject<USkinData>(InParent, Class, Name, Flags);
	return SkinAsset;
}

Thanks for taking the time reading my question i’ll appreciate everything you can say about this error.

Factories are essentially used to create assets in editor. So they should not be part of a game. To exclude factory from packaging you need to create editor module in your project, and put factory code inside that module. Then, from the module .Build.cs file you can reference UnrealEd.

Here’s a tutorial on how to create an editor module https://sandordaemen.nl/blog/creating-an-editor-module-in-unreal-engine-4/

Thanks dude i spent all the day fixing the project almost commit suicide but you saved me you rock!.