hi all,
After dig all the related issue here, i could not find a way to solve it. have checked the variable and scope.
Able to debug and Run this cant publish.
Error as below:
telegram hoh grp.xaml: BC30451: ‘_out_NApplicationCard_1__OutUiElement’ is not declared. It may be inaccessible due to its protection level. The activity output is missing because the activity no longer exists in the current workflow. Use a different variable or select another input option.
@hongheng_ku,
Welcome to the UiPath Community!
Please share the error reproducing steps or logic so it will easy to help you.
Thanks,
Ashok 
<Activity mc:Ignorable="sap sap2010" x:Class="Main" VisualBasic.Settings="{x:Null}" sap:VirtualizedContainerService.HintSize="1234,1295" sap2010:WorkflowViewState.IdRef="ActivityBuilder_1" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System.Private.CoreLib" xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=System.Private.CoreLib" xmlns:ui="http://schemas.uipath.com/workflow/activities" xmlns:uix="http://schemas.uipath.com/workflow/activities/uix" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<sco:Collection x:TypeArguments="x:String">
<x:String>System.Activities</x:String>
<x:String>System.Activities.Statements</x:String>
<x:String>System.Activities.Expressions</x:String>
<x:String>System.Activities.Validation</x:String>
<x:String>System.Activities.XamlIntegration</x:String>
<x:String>Microsoft.VisualBasic</x:String>
<x:String>Microsoft.VisualBasic.Activities</x:String>
<x:String>System</x:String>
<x:String>System.Collections</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Collections.ObjectModel</x:String>
<x:String>System.Data</x:String>
<x:String>System.Diagnostics</x:String>
<x:String>System.Drawing</x:String>
<x:String>System.IO</x:String>
<x:String>System.Linq</x:String>
<x:String>System.Net.Mail</x:String>
<x:String>System.Xml</x:String>
<x:String>System.Xml.Linq</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>
<x:String>System.Windows.Markup</x:String>
<x:String>GlobalVariablesNamespace</x:String>
<x:String>GlobalConstantsNamespace</x:String>
<x:String>System.Runtime.Serialization</x:String>
<x:String>UiPath.UIAutomationNext.Enums</x:String>
<x:String>UiPath.UIAutomationCore.Contracts</x:String>
<x:String>UiPath.UIAutomationNext.Activities</x:String>
<x:String>UiPath.Shared.Activities</x:String>
<x:String>UiPath.Platform.ObjectLibrary</x:String>
<x:String>UiPath.Platform.ResourceHandling</x:String>
<x:String>System.Reflection</x:String>
</sco:Collection>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<sco:Collection x:TypeArguments="AssemblyReference">
<AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>PresentationCore</AssemblyReference>
<AssemblyReference>PresentationFramework</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>System.Collections</AssemblyReference>
<AssemblyReference>System.ComponentModel.TypeConverter</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System.Data.Common</AssemblyReference>
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Drawing.Common</AssemblyReference>
<AssemblyReference>System.Drawing.Primitives</AssemblyReference>
<AssemblyReference>System.Linq</AssemblyReference>
<AssemblyReference>System.Net.Mail</AssemblyReference>
<AssemblyReference>System.ObjectModel</AssemblyReference>
<AssemblyReference>System.Private.CoreLib</AssemblyReference>
<AssemblyReference>System.Private.DataContractSerialization</AssemblyReference>
<AssemblyReference>System.Private.ServiceModel</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization.Formatters</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization.Primitives</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>UiPath.Excel.Activities</AssemblyReference>
<AssemblyReference>UiPath.Mail.Activities</AssemblyReference>
<AssemblyReference>UiPath.OCR.Activities</AssemblyReference>
<AssemblyReference>UiPath.Platform</AssemblyReference>
<AssemblyReference>UiPath.Studio.Constants</AssemblyReference>
<AssemblyReference>UiPath.System.Activities</AssemblyReference>
<AssemblyReference>UiPath.Testing.Activities</AssemblyReference>
<AssemblyReference>UiPath.UiAutomation.Activities</AssemblyReference>
<AssemblyReference>UiPath.UIAutomationCore</AssemblyReference>
<AssemblyReference>UiPath.UIAutomationNext</AssemblyReference>
<AssemblyReference>UiPath.UIAutomationNext.Activities</AssemblyReference>
<AssemblyReference>UiPath.Workflow</AssemblyReference>
<AssemblyReference>WindowsBase</AssemblyReference>
<AssemblyReference>System.Reflection.DispatchProxy</AssemblyReference>
<AssemblyReference>System.Reflection.TypeExtensions</AssemblyReference>
<AssemblyReference>System.Reflection.Metadata</AssemblyReference>
<AssemblyReference>NPOI</AssemblyReference>
<AssemblyReference>UiPath.Excel.Activities.Design</AssemblyReference>
<AssemblyReference>System.Memory.Data</AssemblyReference>
<AssemblyReference>System.Console</AssemblyReference>
<AssemblyReference>System.Configuration.ConfigurationManager</AssemblyReference>
<AssemblyReference>System.Security.Permissions</AssemblyReference>
<AssemblyReference>System.ComponentModel</AssemblyReference>
<AssemblyReference>System.Memory</AssemblyReference>
<AssemblyReference>System.Private.Uri</AssemblyReference>
</sco:Collection>
</TextExpression.ReferencesForImplementation>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="ShouldExpandAll">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Sequence DisplayName="Main Sequence" sap:VirtualizedContainerService.HintSize="668,1230" sap2010:WorkflowViewState.IdRef="Sequence_1">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<uix:NApplicationCard AttachMode="ByInstance" DisplayName="grp hoh – (10648)" sap:VirtualizedContainerService.HintSize="606,1119" sap2010:WorkflowViewState.IdRef="NApplicationCard_1" ScopeGuid="6f59b4d8-e944-4a62-ab5e-1099da3eeb32" Version="V2">
<uix:NApplicationCard.Body>
<ActivityAction x:TypeArguments="x:Object">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:Object" Name="WSSessionData" />
</ActivityAction.Argument>
<Sequence sap:VirtualizedContainerService.HintSize="572,828" sap2010:WorkflowViewState.IdRef="Sequence_5">
<Sequence.Variables>
<Variable x:TypeArguments="x:Int32" Name="counter">
<Variable.Default>
<Literal x:TypeArguments="x:Int32" />
</Variable.Default>
</Variable>
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:InterruptibleDoWhile CurrentIndex="{x:Null}" DisplayName="Do While" sap:VirtualizedContainerService.HintSize="510,713" sap2010:WorkflowViewState.IdRef="InterruptibleDoWhile_1">
<ui:InterruptibleDoWhile.Body>
<Sequence DisplayName="Body" sap:VirtualizedContainerService.HintSize="476,577" sap2010:WorkflowViewState.IdRef="Sequence_3">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<uix:NTakeScreenshot DisplayName="Take Screenshot" FileName="screenshot.png" FileNameMode="None" sap:VirtualizedContainerService.HintSize="434,190" sap2010:WorkflowViewState.IdRef="NTakeScreenshot_1" SaveScreenshotTo="Image" Version="V3" />
<uix:NMouseScroll KeyModifiers="{x:Null}" Direction="Down" DisplayName="Mouse Scroll" sap:VirtualizedContainerService.HintSize="434,137" sap2010:WorkflowViewState.IdRef="NMouseScroll_1" InteractionMode="HardwareEvents" MovementUnits="14" Version="V3">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">False</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</uix:NMouseScroll>
<Assign sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_1">
<Assign.To>
<OutArgument x:TypeArguments="x:Int32">[counter]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Int32">[counter+1]</InArgument>
</Assign.Value>
</Assign>
</Sequence>
</ui:InterruptibleDoWhile.Body>
<ui:InterruptibleDoWhile.Condition>
<VisualBasicValue x:TypeArguments="x:Boolean" ExpressionText="counter<=5" />
</ui:InterruptibleDoWhile.Condition>
</ui:InterruptibleDoWhile>
</Sequence>
</ActivityAction>
</uix:NApplicationCard.Body>
<uix:NApplicationCard.TargetApp>
<uix:TargetApp Area="0, 0, 0, 0" ContentHash="7iCHlxNUvkCfXOg0aQb_pw" FilePath="C:\Users\admin\AppData\Roaming\Telegram Desktop\telegram.exe" IconBase64="iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAPLSURBVFhH1ZdJTBNhFMcLRmVTUVGxErYAZR0xnEw0HPTkwejBAwlejPFg4pJw0igiuFZcADeQSitQDCoIBpeAGFBxYZG2QitaCxVILBCJC3Vpeb6HaWHoTBmgPTjJL/36zXv////7OtNORaL/8RDvyvdhbnTGM2XG9WPgmObcuhamWCdhlD0nEsuM7Ynl/ZbVN3thddmnf+CY5ugc1VCty8LElOojE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TwAAAABJRU5ErkJggg==" InformativeScreenshot="0b4978855e673a7a71b8a20805124558.png" Reference="Thry96IZEEaS5l3guMtKtw/WzdIorSsY0iFKPuFaTJsBg" Selector="<wnd app='telegram.exe' cls='Qt*QWindowIcon' title='grp hoh – (10648)' />" Title="grp hoh – (10648)" />
</uix:NApplicationCard.TargetApp>
</uix:NApplicationCard>
</Sequence>
</Activity>