Exception read access violation UClass::GetAuthoritativeClass returned nullptr

I’m tweaking the Shooter Game package and I haven’t altered any code.

When I hit compile in the editor, I receive the following exception:

How can I fix this issue and is there any way to dig into this exception more to get more details?

[2020.12.25-21.02.04:848][289]Candidate modules for hot reload:
[2020.12.25-21.02.04:848][289]  ShooterGame
[2020.12.25-21.02.04:848][289]  ShooterGameLoadingScreen
[2020.12.25-21.02.04:851][289]Launching UnrealBuildTool... [D:/UE_4.26/Engine/Binaries/DotNET/UnrealBuildTool.exe  -ModuleWithSuffix=ShooterGame,8668 -ModuleWithSuffix=ShooterGameLoadingScreen,593 ShooterGameEditor Win64 Development -Project="C:/Users/samki/Documents/Unreal Projects/Unreal-Game/ShooterGame2.uproject" "C:/Users/samki/Documents/Unreal Projects/Unreal-Game/ShooterGame2.uproject"  -IgnoreJunk]
[2020.12.25-21.02.05:124][289]Warning: Starting HotReload took  0.4s.
[2020.12.25-21.02.08:884][468]CompilerResultsLog: New page: Compilation - Dec 25, 2020, 11:02:08 AM
[2020.12.25-21.02.08:888][468]CompilerResultsLog: Using 'git status' to determine working set for adaptive non-unity build (C:\Users\samki\Documents\Unreal Projects\Unreal-Game).
[2020.12.25-21.02.08:889][468]CompilerResultsLog: Building ShooterGameEditor...
[2020.12.25-21.02.08:889][468]CompilerResultsLog: Using Visual Studio 2019 14.28.29335 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
[2020.12.25-21.02.08:889][468]CompilerResultsLog: [Upgrade]
[2020.12.25-21.02.08:889][468]CompilerResultsLog: [Upgrade] Using backward-compatible build settings. The latest version of UE4 sets the following values by default, which may require code changes:
[2020.12.25-21.02.08:889][468]CompilerResultsLog: [Upgrade]     bLegacyPublicIncludePaths = false                 => Omits subfolders from public include paths to reduce compiler command line length. (Previously: true).
[2020.12.25-21.02.08:889][468]CompilerResultsLog: [Upgrade]     ShadowVariableWarningLevel = WarningLevel.Error   => Treats shadowed variable warnings as errors. (Previously: WarningLevel.Warning).
[2020.12.25-21.02.08:889][468]CompilerResultsLog: [Upgrade]     PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs   => Set in build.cs files to enables IWYU-style PCH model. See https://docs.unrealengine.com/en-US/Programming/BuildTools/UnrealBuildTool/IWYU/index.html. (Previously: PCHUsageMode.UseSharedPCHs).
[2020.12.25-21.02.08:889][468]CompilerResultsLog: [Upgrade] Suppress this message by setting 'DefaultBuildSettings = BuildSettingsVersion.V2;' in ShooterGameEditor.Target.cs, and explicitly overriding settings that differ from the new defaults.
[2020.12.25-21.02.08:890][468]CompilerResultsLog: [Upgrade]
[2020.12.25-21.02.08:890][468]CompilerResultsLog: Building 5 actions with 12 processes...
[2020.12.25-21.02.08:890][468]CompilerResultsLog:   [1/5] UE4Editor-ShooterGameLoadingScreen-0593.lib
[2020.12.25-21.02.08:890][468]CompilerResultsLog:      Creating library C:\Users\samki\Documents\Unreal Projects\Unreal-Game\Intermediate\Build\Win64\UE4Editor\Development\ShooterGameLoadingScreen\UE4Editor-ShooterGameLoadingScreen-0593.lib and object C:\Users\samki\Documents\Unreal Projects\Unreal-Game\Intermediate\Build\Win64\UE4Editor\Development\ShooterGameLoadingScreen\UE4Editor-ShooterGameLoadingScreen-0593.exp
[2020.12.25-21.02.08:890][468]CompilerResultsLog:   [2/5] UE4Editor-ShooterGame-8668.lib
[2020.12.25-21.02.08:890][468]CompilerResultsLog:      Creating library C:\Users\samki\Documents\Unreal Projects\Unreal-Game\Intermediate\Build\Win64\UE4Editor\Development\ShooterGame\UE4Editor-ShooterGame-8668.lib and object C:\Users\samki\Documents\Unreal Projects\Unreal-Game\Intermediate\Build\Win64\UE4Editor\Development\ShooterGame\UE4Editor-ShooterGame-8668.exp
[2020.12.25-21.02.08:890][468]CompilerResultsLog:   [3/5] UE4Editor-ShooterGameLoadingScreen-0593.dll
[2020.12.25-21.02.08:890][468]CompilerResultsLog:      Creating library C:\Users\samki\Documents\Unreal Projects\Unreal-Game\Intermediate\Build\Win64\UE4Editor\Development\ShooterGameLoadingScreen\UE4Editor-ShooterGameLoadingScreen-0593.suppressed.lib and object C:\Users\samki\Documents\Unreal Projects\Unreal-Game\Intermediate\Build\Win64\UE4Editor\Development\ShooterGameLoadingScreen\UE4Editor-ShooterGameLoadingScreen-0593.suppressed.exp
[2020.12.25-21.02.08:890][468]CompilerResultsLog:   [4/5] UE4Editor-ShooterGame-8668.dll
[2020.12.25-21.02.08:891][468]CompilerResultsLog:      Creating library C:\Users\samki\Documents\Unreal Projects\Unreal-Game\Intermediate\Build\Win64\UE4Editor\Development\ShooterGame\UE4Editor-ShooterGame-8668.suppressed.lib and object C:\Users\samki\Documents\Unreal Projects\Unreal-Game\Intermediate\Build\Win64\UE4Editor\Development\ShooterGame\UE4Editor-ShooterGame-8668.suppressed.exp
[2020.12.25-21.02.08:891][468]CompilerResultsLog:   [5/5] ShooterGameEditor.target
[2020.12.25-21.02.08:891][468]CompilerResultsLog: Total time in Parallel executor: 2.30 seconds
[2020.12.25-21.02.08:891][468]CompilerResultsLog: Total execution time: 3.39 seconds
[2020.12.25-21.02.08:892][468]LogMainFrame: MainFrame: Module compiling took 4.135 seconds
'UE4Editor.exe' (Win32): Loaded 'C:\Users\samki\Documents\Unreal Projects\Unreal-Game\Binaries\Win64\UE4Editor-ShooterGame-8668.dll'. Symbols loaded.
[2020.12.25-21.02.09:444][468]LogClass: EOnlineMode HotReload.
[2020.12.25-21.02.09:444][468]LogClass: EClassRepNodeMapping HotReload.
[2020.12.25-21.02.09:444][468]LogClass: EShooterPhysMaterialType HotReload.
[2020.12.25-21.02.09:444][468]LogClass: ShooterChatStyle HotReload.
[2020.12.25-21.02.09:449][468]LogClass: ShooterMenuItemStyle HotReload.
[2020.12.25-21.02.09:449][468]LogClass: ShooterMenuSoundsStyle HotReload.
[2020.12.25-21.02.09:449][468]LogClass: ShooterMenuStyle HotReload.
[2020.12.25-21.02.09:449][468]LogClass: ShooterOptionsStyle HotReload.
[2020.12.25-21.02.09:450][468]LogClass: ShooterScoreboardStyle HotReload.
[2020.12.25-21.02.09:450][468]LogClass: TakeHitInfo HotReload.
[2020.12.25-21.02.09:450][468]LogClass: DecalData HotReload.
[2020.12.25-21.02.09:450][468]LogClass: WeaponAnim HotReload.
[2020.12.25-21.02.09:450][468]LogClass: WeaponData HotReload.
[2020.12.25-21.02.09:450][468]LogClass: InstantWeaponData HotReload.
[2020.12.25-21.02.09:450][468]LogClass: InstantHitInfo HotReload.
[2020.12.25-21.02.09:450][468]LogClass: ProjectileWeaponData HotReload.
[2020.12.25-21.02.09:629][468]LogHotReload: Re-instancing ShooterSpectatorPawn after hot-reload.
[2020.12.25-21.02.09:668][468]LogHotReload: Re-instancing ShooterTeamStart after hot-reload.
Exception thrown: read access violation.
**UClass::GetAuthoritativeClass[virtual]**(...) returned nullptr.

Did you ever find the answer to this?

I managed to work around it by creating a BP class that inherits from my C++ class instead of just dropping my C++ class directly into my level. I consider this a workaround, as it feels like I shouldn’t have to take this step. Probably a UCLASS macro thing, but I’ve tried a bunch of combinations and I have had no success.