Cannot package plugin due to "Value cannot be null. (Parameter 'element')"

Greetings,

I have tried to create a plugin for the marketplace for the 1st time. I had created my C++ without making a plugin first (as I didn’t plan to make it a plugin at start) and I now cannot package it.

Every time I run it, this is what I get:


Running AutomationTool...
Using bundled DotNet SDK version: 6.0.302
Starting AutomationTool...
Parsing command line: BuildPlugin -Plugin=E:\UE\Projects\FinalPlugin\ImprovedPerception\ImprovedPerception.uplugin -Package=D:\SomePluginPackage -Rocket
Initializing script modules...
Total script module initialization time: 0.40 s.
Using I:\Visual Studio\Community2022\MSBuild\Current\Bin\MSBuild.exe
Executing commands...
Copying 55 file(s) using max 64 thread(s)
Reading plugin from D:\SomePluginPackage\HostProject\Plugins\ImprovedPerception\ImprovedPerception.uplugin...
Building plugin for host platforms: Win64
Running: E:\UE\UE_5.4\Engine\Binaries\ThirdParty\DotNet\6.0.302\windows\dotnet.exe "E:\UE\UE_5.4\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" UnrealEditor Win64 Development -Project="D:\SomePluginPackage\HostProject\HostProject.uproject" -plugin="D:\SomePluginPackage\HostProject\Plugins\ImprovedPerception\ImprovedPerception.uplugin" -noubtmakefiles -manifest="D:\SomePluginPackage\HostProject\Saved\Manifest-UnrealEditor-Win64-Development.xml" -nohotreload -log="C:\Users\delva\AppData\Roaming\Unreal Engine\AutomationTool\Logs\E+UE+UE_5.4\UBA-UnrealEditor-Win64-Development.txt"
Log file: C:\Users\delva\AppData\Roaming\Unreal Engine\AutomationTool\Logs\E+UE+UE_5.4\UBA-UnrealEditor-Win64-Development.txt
Total execution time: 5.14 seconds
Unhandled exception: System.ArgumentNullException: Value cannot be null. (Parameter 'element')
   at System.Attribute.GetCustomAttributes(MemberInfo element, Type attributeType, Boolean inherit)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttributes[T](MemberInfo element)
   at UnrealBuildTool.ModuleRules.IsValidForTarget(Type moduleType, ReadOnlyTargetRules targetRules, String& invalidReason) in E:\UE\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\ModuleRules.cs:line 1636
   at UnrealBuildTool.UEBuildTarget.AddAllValidModulesToTarget(ILogger Logger) in E:\UE\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 3938
   at UnrealBuildTool.UEBuildTarget.PreBuildSetup(ILogger Logger) in E:\UE\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 3403
   at UnrealBuildTool.UEBuildTarget.Create(TargetDescriptor Descriptor, Boolean bSkipRulesCompile, Boolean bForceRulesCompile, Boolean bUsePrecompiled, UnrealIntermediateEnvironment IntermediateEnvironment, ILogger Logger) in E:\UE\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 1392
   at UnrealBuildTool.UEBuildTarget.Create(TargetDescriptor Descriptor, BuildConfiguration BuildConfiguration, ILogger Logger) in E:\UE\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 1226
   at UnrealBuildTool.BuildMode.CreateMakefileAsync(BuildConfiguration BuildConfiguration, TargetDescriptor TargetDescriptor, ISourceFileWorkingSet WorkingSet, ILogger Logger) in E:\UE\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 1114
   at UnrealBuildTool.BuildMode.BuildAsync(List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, BuildOptions Options, FileReference WriteOutdatedActionsFile, ILogger Logger, Boolean bSkipPreBuildTargets) in E:\UE\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 396
   at UnrealBuildTool.BuildMode.ExecuteAsync(CommandLineArguments Arguments, ILogger Logger) in E:\UE\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 252
   at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in E:\UE\UE_5.4\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 660
Took 5.60s to run dotnet.exe, ExitCode=6
UnrealBuildTool failed. See log for more details. (C:\Users\delva\AppData\Roaming\Unreal Engine\AutomationTool\Logs\E+UE+UE_5.4\UBA-UnrealEditor-Win64-Development.txt)
AutomationTool executed for 0h 0m 9s
AutomationTool exiting with ExitCode=6 (6)
BUILD FAILED

I asked on Discord, Reddit, checked google, but nothing seemed to work. The two cases i found I could not make work either. I am at a loss at what to do.

Strangely, in the location where I ask for the plugin to be created, something is created. i get a HostProject, and my plugin seems to transfer properly, but I still get this big error in packaging. Is it safe to ignore? Or is there something I can do to solve it?

Thanks and have a wonderful rest of your day.

Use this plugin to package your plugin. GitHub - Naotsun19B/PluginBuilder-Document: This Unreal Engine plugin adds a tools menu to build plugin with multiple engine versions and compresses the built plugin into a ZIP file format ready for submission to the marketplace.

this doesn’t fix the issue, this plugin appears in the epic store as ‘Plugin Builder’ and in it I asked the author about the issue, users can read the latest review of the plugin to see his answer, which was to possibly reinstall everything and try again. For the record, the issue has been around for over half a year, and as a new user it boggles my mind that something so fundamental hasn’t been addressed despite numerous forum threads and bug reports.

Having just done an updated search, this may be a solution, cautiously optimistic:

Thank you for your solution, by recompiling UnrealBuildTool I obtained the actual error messages:

WARNING: Absolute path ‘C:\Users\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.dep.json’ has length ‘261’ which is greater than MAX_PATH (260) and may cause unexpected errors with the MSVC toolchain.

Then I shortened the path and it was able to compile successfully!

For me, this was caused by the Nvidia Omniverse plugin. The workaround in [UBT Bug] No longer able to compile plugins in standalone since 5.3 - #11 by Sam_Swain worked for me.