Facing issue while publishing the process from studio

Hi Team,

while publishing the process from studio. it is throwing an error as shown below.

System.NullReferenceException: Object reference not set to an instance of an object.
at UiPath.ActivityCompiler.Preprocessing.WorkflowInvokeListBuilder.BuildList(LoggingScope scope, IEnumerable1 workflows, IEnumerable1 sourceFiles, Boolean processWorkflows, Boolean validateWorkflows)
at UiPath.ActivityCompiler.CommandLine.Utils.CompilationPrerequisitesUtils.<>c__DisplayClass1_0.b__3(LoggingScope listBuilderScope)
at UiPath.WorkflowProcessor.Common.Logging.LoggingScope.Execute(Action1 action) at UiPath.ActivityCompiler.Logging.LoggingManager.ExecuteXamlListBuilder(LoggingScope parent, Action1 action)
at UiPath.ActivityCompiler.CommandLine.Utils.CompilationPrerequisitesUtils.<>c__DisplayClass1_1.b__0(LoggingScope compilerScope)
at UiPath.WorkflowProcessor.Common.Logging.LoggingScope.Execute(Action1 action) at UiPath.ActivityCompiler.Logging.LoggingManager.ExecutePreCompile(LoggingScope parent, Action1 action)
at UiPath.ActivityCompiler.CommandLine.Utils.CompilationPrerequisitesUtils.EnsureCompilationPrerequisite(LoggingScope mainScope, CommandLineOptions programArgs)
at UiPath.ActivityCompiler.CommandLine.CommandLineCompiler.ExecuteCompilation(LoggingScope loggingScope, CommandLineOptions programArgs)
at UiPath.ActivityCompiler.CommandLine.CommandLineCompiler.RunCompiler(LoggingScope loggingScope, CommandLineOptions programArgs)
at UiPath.ActivityCompiler.CommandLine.Program.<>c__DisplayClass4_0.b__1(StudioOptions opts)
at CommandLine.ParserResultExtensions.MapResult[T1,T2,TResult](ParserResult1 result, Func2 parsedFunc1, Func2 parsedFunc2, Func2 notParsedFunc)
at UiPath.ActivityCompiler.CommandLine.Program.RunCompiler(TraceListener consoleTracer, LoggingScope scope, ICommandLineCompiler projectCompiler, String args)

Could you pls help to rectify this error.
Thank you

Hi @lakshminarayana_chavala

Could you please

  1. Check Variables and arguments have been initailized properly or not.
  2. Try to check every invoke workflow activity whether mapped your arguments/variables in a proper way
  3. Try to use remove unused variables/arguments in the project.
  4. Check everything went well by using workflow analyser.
  5. Check all the dependencies versions are been compatible with other

Hope it helps!!

Do Validate project before you publish. This will highlight any issues that exists in the project, missing components or arguments.

@lakshminarayana_chavala

In your code there is variable created and didn’t pass the any values.

and also look below thread

Happy automation
YK

Hi @lakshminarayana_chavala

Check the below thread

Regards
PS Parvathy

Hi @RaoAshish, I validated the project it is showing no errors

Hi @lakshminarayana_chavala

This error usually happens due to a null or broken reference somewhere in the project, such as an invalid Invoke Workflow, uninitialized argument, or a corrupted XAML or dependency. Apart from basic checks, you should also verify your Main.xaml, remove any unused or broken workflows, check the project.json file for corruption, and try reinstalling or updating all packages. Deleting the .local folder and reopening the project often helps refresh dependencies.
If the issue still persists, try recreating the suspected workflow in a new file or shortening the project path, as sometimes hidden corruption or path issues can cause this during publish.