Can't package project with own DataAssets

Hi, after creating my own DataAsset I can’t package my project. It works perfect in the editor but after trying to package it I got an error: Unknown Cook Failure. I found that these lines are trying to tell me what is wrong, but I don’t know how to fix it:

UATHelper: Packaging (Windows (64-bit)):   LogAssetManager: Error: Registered PrimaryAssetId Items:WoodItem for asset /Game/DataAssets/Items/WoodItem.WoodItem does not match object's real id of ! This will not load properly at runtime!
UATHelper: Packaging (Windows (64-bit)):   LogAssetManager: Error: Registered PrimaryAssetId Items:StoneItem for asset /Game/DataAssets/Items/StoneItem.StoneItem does not match object's real id of ! This will not load properly at runtime!
PackagingResults: Error: Registered PrimaryAssetId Items:WoodItem for asset /Game/DataAssets/Items/WoodItem.WoodItem does not match object's real id of ! This will not load properly at runtime!
PackagingResults: Error: Registered PrimaryAssetId Items:StoneItem for asset /Game/DataAssets/Items/StoneItem.StoneItem does not match object's real id of ! This will not load properly at runtime!

and here:

UATHelper: Packaging (Windows (64-bit)):   LogInit: Display: LogAssetManager: Error: Registered PrimaryAssetId Items:WoodItem for asset /Game/DataAssets/Items/WoodItem.WoodItem does not match object's real id of ! This will not load properly at runtime!
UATHelper: Packaging (Windows (64-bit)):   LogInit: Display: LogAssetManager: Error: Registered PrimaryAssetId Items:StoneItem for asset /Game/DataAssets/Items/StoneItem.StoneItem does not match object's real id of ! This will not load properly at runtime!

Own DataAsset code:

UCLASS(BlueprintType)
class SURVIVAL_API UItemDataAsset : public UDataAsset
{
    GENERATED_BODY()

public:
    UPROPERTY(EditAnywhere, BlueprintReadOnly)
    FName itemID;
    UPROPERTY(EditAnywhere, BlueprintReadOnly)
    FText name;

};

I’ve also disabled “Is Editor Only” and selected “Always Cook” in Asset Manager settings.

Do you know how to fix it?

1 Like

Hello,
try checking “Should manager determine Type and Name”. This helped me solve it without manually implementing Asset ID.

5 Likes

This helped me, too! Thank you!

The previous answer didn’t work for me, since it was already checked. But uncheaking “Has Blueprint Classes” did.

Cheers,

2 Likes

Thank you!
It works!