Packing errors with CLI

I’m using the latest Studio and Robot versions of 23.10 on Orchestrator Cloud.
Trying to start using the UiPath CLI for packing and deploying projects, but it is been quite a challenge (was having same issues on 23.4 as well).
First, when packing projects the the CLI, many times it will pack and deploy without error. Then when trying to run the package from a robot, the job instantly fails with the message “Could not load file or assembly ‘UiPath.System.Activities, Version=, Culture=neutral, PublicKeyToken=null’. The system cannot find the file specified.” I tried editing Orchestrator deployment settings to “Only tenant feed” as well as “Both host and tenant feeds” selected, and same issue with both. After lots of trial and error I found weird workarounds that get this to work. Below are the steps:

  1. Replace the packages “UiPath.System.Activities” and “UiPath.UIAutomation.Activities” with “UiPath.System.Activities.Runtime” and “UiPath.UIAutomation.Activities.Runtime”
  2. This will now result in strange errors showing up when packing via CLI. Things that are not an issue at all when publishing straight from Studio. For example, every xaml file with a Matches activity was resulting an the error: Unable to create activity builder for [xaml filename]. Reason was 'Cannot set unknown member 'UiPath.Core.Activities.Matches.FirstMatch'.'. Similar issue for any file with a GetLastDownloadedFile activity: Cannot set unknown member 'UiPath.Core.Activities.GetLastDownloadedFile.FileResource'.'.
  3. Fix the above errors by replacing opening the xaml files in a text editor, finding each occurrence of the above activities, and delete the FirstMatch="{x:Null}" from the Matches activities, and delete the FileResource="{x:Null}" from the GetLastDownloadedFile activities. I could not find a way to resolve these issues from Studio itself (creating a variable to store these outputs did not work).
  4. Once all errors are cleared, CLI will successfully pack, deploy, and run correctly from the robots.

Big problem with this “solution” - after I replace the packages “UiPath.System.Activities” and “UiPath.UIAutomation.Activities” with the runtime equivalents, I cannot use any activities that are from these packages, i.e. click, type into, etc… They aren’t available in the Activities tray. If you add the packages back (and have both the runtime and design time packages), then you can use the activities in Studio again, but cannot pack via CLI.

Anyone else experience this and have a fix that will make leveraging the CLI not a huge hassle?

Hi @BCod

Could you share the command lines are you using to packing and deploying projects?

{full path}\uipcli.exe package pack -o {full path of output folder} --autoVersion --libraryOrchestratorAuthToken {token} --libraryOrchestratorAccountName {accountName} --libraryOrchestratorUrl UiPath --libraryOrchestratorTenant Dev

It keeps auto-hyperlinking the libraryOrchestratorUrl, not sure how to stop that

I was able to identify the issue had to do with custom libraries that were published to Orchestrator and in use by this project.
I resolved the issue by opening each library project, updating the UiPath.System.Activities package to the latest version (23.10.2) and then I had to publish the library via CLI (if published via Studio I got errors when trying to pack the other project).

1 Like