admin管理员组

文章数量:1400218

Been working on a C++/BP unreal 5.3 project for about a year now and all of a sudden, any time we add a new UFUNCTION or UPROPERTY declaration, the entire build massively fails with hundreds of random errors in the code. If i simply comment out the UFUNCTION/UPROPERTY, there are zero errors and both the build and editor function correctly.

#pragma once
#include "CoreMinimal.h"
#include "DevHelp.generated.h"

UCLASS(BlueprintType)
class VR_BASE_API UDevHelp : public UObject {
    GENERATED_BODY()

public:
    //Build works if UFUNCTION is commented out
    UFUNCTION(BlueprintCallable, Category = "00 Test")
    float DoMath(float first, float second) {
        return first * second;
    }
};

UBT log just claims OtherCompilationError after spewing over 100 random errors. (All of which clear when commenting out the UFUNCTION declaration)

CompilationResultException: Error: OtherCompilationError
   at UnrealBuildTool.ActionGraph.ExecuteActionsAsync(BuildConfiguration BuildConfiguration, List`1 ActionsToExecute, List`1 TargetDescriptors, ILogger Logger, IActionArtifactCache actionArtifactCache) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\System\ActionGraph.cs:line 417
   at UnrealBuildTool.BuildMode.BuildAsync(TargetMakefile[] Makefiles, List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, BuildOptions Options, FileReference WriteOutdatedActionsFile, ILogger Logger) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 801
   at UnrealBuildTool.BuildMode.BuildAsync(List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, BuildOptions Options, FileReference WriteOutdatedActionsFile, ILogger Logger, Boolean bSkipPreBuildTargets) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 411
   at UnrealBuildTool.BuildMode.ExecuteAsync(CommandLineArguments Arguments, ILogger Logger) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 252
   at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 659

This occurs regardless of whether the class inherits from a UObject or UBlueprintFunctionLibrary. Regardless of whether the function is instanced or static. Regardless of if we use a new, or old file. Additionally, the same issue exists regardless of if we use a UPROPERTY, or UFUNCTION within a USTRUCT, or UCLASS.

So far I've:

  • Re-written/restored MyGame.target.cs, and MyGame.Editor.Target.cs
  • Reverted the entire project repo.
  • Deleted: Saved, Intermediate, DerivedDataCache, Binaries, and .vs folders.
  • Regenerated Visual Studio Project Files. (~20-30 times now)
  • Reinstalled Unreal Engine.
  • Updated Visual Studio. (2022 14.13.2)
  • Tried on a different computer.

All without success or additional indicators of where UBT's gone wrong...

Been working on a C++/BP unreal 5.3 project for about a year now and all of a sudden, any time we add a new UFUNCTION or UPROPERTY declaration, the entire build massively fails with hundreds of random errors in the code. If i simply comment out the UFUNCTION/UPROPERTY, there are zero errors and both the build and editor function correctly.

#pragma once
#include "CoreMinimal.h"
#include "DevHelp.generated.h"

UCLASS(BlueprintType)
class VR_BASE_API UDevHelp : public UObject {
    GENERATED_BODY()

public:
    //Build works if UFUNCTION is commented out
    UFUNCTION(BlueprintCallable, Category = "00 Test")
    float DoMath(float first, float second) {
        return first * second;
    }
};

UBT log just claims OtherCompilationError after spewing over 100 random errors. (All of which clear when commenting out the UFUNCTION declaration)

CompilationResultException: Error: OtherCompilationError
   at UnrealBuildTool.ActionGraph.ExecuteActionsAsync(BuildConfiguration BuildConfiguration, List`1 ActionsToExecute, List`1 TargetDescriptors, ILogger Logger, IActionArtifactCache actionArtifactCache) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\System\ActionGraph.cs:line 417
   at UnrealBuildTool.BuildMode.BuildAsync(TargetMakefile[] Makefiles, List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, BuildOptions Options, FileReference WriteOutdatedActionsFile, ILogger Logger) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 801
   at UnrealBuildTool.BuildMode.BuildAsync(List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, BuildOptions Options, FileReference WriteOutdatedActionsFile, ILogger Logger, Boolean bSkipPreBuildTargets) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 411
   at UnrealBuildTool.BuildMode.ExecuteAsync(CommandLineArguments Arguments, ILogger Logger) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 252
   at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 659

This occurs regardless of whether the class inherits from a UObject or UBlueprintFunctionLibrary. Regardless of whether the function is instanced or static. Regardless of if we use a new, or old file. Additionally, the same issue exists regardless of if we use a UPROPERTY, or UFUNCTION within a USTRUCT, or UCLASS.

So far I've:

  • Re-written/restored MyGame.target.cs, and MyGame.Editor.Target.cs
  • Reverted the entire project repo.
  • Deleted: Saved, Intermediate, DerivedDataCache, Binaries, and .vs folders.
  • Regenerated Visual Studio Project Files. (~20-30 times now)
  • Reinstalled Unreal Engine.
  • Updated Visual Studio. (2022 14.13.2)
  • Tried on a different computer.

All without success or additional indicators of where UBT's gone wrong...

Share Improve this question edited Mar 24 at 19:32 Reahreic asked Mar 24 at 19:25 ReahreicReahreic 6442 gold badges9 silver badges33 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I'm not super confidant with UE5, but I have had this happen to me and I can't remember what I did to fix it.

Are you always using

UCLASS(BlueprintType)

As the class type? All mine use UCLASS()

Using my IT support hat, what about a fresh project? Where are you generating the new class? Same result inside an already working class?

本文标签: Adding any UFUNCTION or UPROPERTY breaks Unreal buildStack Overflow