Error when adding CV activities

I’ve installed UiPath AI Computer Vision package, but when I tried to invoke the activities I got the error message like below:
19.4.4+Branch.support/v2019.4.Sha.6d308c7f5a32b559373887ae421ce7eaec8f8d24

Exception has been thrown by the target of an invocation.

Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.TypeInitializationException: The type initializer for ‘UiPath.CV.Activities.Design.Services.DefaultSettingsService’ threw an exception. —> System.MissingMethodException: Method not found: 'Void UiPath.Core.Activities.OCREngineActivity.set_Profile(System.Activities.InArgument1<UiPath.Vision.OCR.OCRProfile>)'. at UiPath.CV.Activities.Design.Services.DefaultSettingsService..cctor() --- End of inner exception stack trace --- at UiPath.CV.Activities.Design.Services.DefaultSettingsService.GetServer(Boolean designTimeRunning) at UiPath.CV.Activities.Design.Services.DefaultSettingsService.IsCloudEndpoint() at UiPath.CV.Activities.Design.CVScopeFactory.CreateInternal(Window ownerWindow) at UiPath.CV.Activities.Design.CVScopeFactory.Create(DependencyObject target, IDataObject dataObject) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at UiPath.Studio.Plugin.Workflow.WorkflowHandling.DesignerWrapper.InsertActivity(String activityClassName) in d:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\WorkflowHandling\DesignerWrapper.cs:line 432 at UiPath.Studio.Plugin.Workflow.Services.WorkflowManagementService.InsertActivity(String workflowId, String activityClassName) in d:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Services\WorkflowManagementService.cs:line 45 at UiPath.Studio.Plugin.Workflow.Services.Interfaces.IWorkflowManagementService.InsertActivity(String workflowId, String activityClassName) at UiPath.Studio.Plugin.Workflow.Services.WorkflowManagementServiceProxy.InsertActivity(String workflowId, String activityClassName) in d:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Services\Proxies\WorkflowManagementServiceProxy.cs:line 20 at UiPath.Studio.Plugin.Workflow.Services.ToolboxWindowServiceProxy.InsertActivity(String activityClassName) in d:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Services\Proxies\ToolboxWindowServiceProxy.cs:line 55 at UiPath.Studio.Plugin.Workflow.Services.Interfaces.IToolboxWindowService.InsertActivity(String activityClassName) at UiPath.Studio.Plugin.Workflow.Services.ToolboxWindowService.InsertActivity(String activityClassName) in d:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Services\ToolboxWindowService.cs:line 117 at UiPath.Studio.Plugin.Workflow.Toolbox.ToolboxControlViewModel.OnExecuteSelectedItem() in d:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Toolbox\ToolboxControlViewModel.cs:line 196 at UiPath.Studio.Shared.ViewModels.GenericTreeViewModel1.ExecuteSelectedItem() in d:\a\1\s\Studio\UiPath.Studio.Shared\ViewModels\GenericTreeViewModel.cs:line 564
at UiPath.Studio.Shared.Controls.GenericTreeView.ProcessKeyAction(RoutedEventArgs e, Key key, Object param) in d:\a\1\s\Studio\UiPath.Studio.Shared\Controls\GenericTreeView.xaml.cs:line 168
at UiPath.Studio.Shared.Controls.GenericTreeView.Tree_PreviewMouseDoubleClick(Object sender, MouseButtonEventArgs e) in d:\a\1\s\Studio\UiPath.Studio.Shared\Controls\GenericTreeView.xaml.cs:line 251
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.Controls.Control.OnPreviewMouseDoubleClick(MouseButtonEventArgs e)
at System.Windows.Controls.Control.HandleDoubleClick(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnPreviewMouseDownThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler), HResult -2146232828

Any suggestions on that? thanks!

@GeWang

Welcome to the UiPath Communtiy.

It seems like didn’t install properly. Could you please uninstall and reinstall it again and then try once.

Have you followed all mentioned steps in the below thread before installing it. If not then try like this.

1 Like

@lakshman
The issue fixed in following steps, thank you for your help!

  1. Remove the Uipath.AI.ComputerVision package.
  2. Remove the UiPath.UIAutomation package from the project panel.
  3. Reinstall the UiPath.AI.ComputerVision package.
    Then it works.
1 Like

@GeWang

Happy to help you :slight_smile: