Remove Unused Dependencies does nothing

If I add a selfmade library and then use Remove Unused Dependencies, it just claims there are no unused dependencies. Eventhough it has just been added and never used.

HI ,

I have taken help from Chat Gpt to acheive the below answer, please kindly let me know if this approach work for you

UiPath sometimes doesn’t remove newly added custom libraries when you run “Remove Unused Dependencies”, even if you haven’t used any of their activities yet.

Let’s unpack why this happens and how to fix or work around it :backhand_index_pointing_down:


:gear: Why UiPath Says “No Unused Dependencies” for Your Custom Library

  1. Custom Libraries Are Treated Differently
  • UiPath considers user-created libraries (local or custom feed) as potentially referenced code, even if none of the activities are used yet.
  • The cleanup analyzer tends to only check official packages (from UiPath Official Feed or Marketplace) for actual usage in workflows.
  • So your custom .nupkg might not get scanned properly by the dependency analysis engine.
  1. Metadata Caching in Project Settings
  • When you add a new library, UiPath updates project.json to include it under "dependencies".
  • The analyzer compares the dependency tree against actual activity usages (found in the .xaml files).
    But for custom activities, UiPath sometimes can’t resolve the activity metadata correctly (especially if the .nupkg is local), so it assumes it might be needed.
  1. If Your Custom Library Has Invokable Components
  • If your library exposes workflow files (XAMLs) or custom types (arguments, assets), UiPath treats it as a “potential runtime dependency” even if you haven’t dragged an activity from it yet.
  • The analyzer errs on the safe side — “better to keep it than break the project.”

:white_check_mark: How to Confirm It’s Really Unused

You can check manually:

  1. Open your project folder.
  2. Search all .xaml files for the library’s namespace or activity name.
    Example search string in Notepad++ or VS Code:
xmlns:yourLibName

or

yourActivityName

If there’s no result → it’s unused.


:broom: Manual Workaround

You can safely remove it manually from your project.json:

  1. Open project.json in a text editor.
  2. Locate the dependency:
"yourLibraryName": "[1.0.0]"
  1. Delete that line (don’t forget commas if it’s in the middle of the list).
  2. Save and reopen the project in UiPath Studio.

UiPath will reload without that dependency — if the library was truly unused, everything will still run fine.


:light_bulb: Optional: Force UiPath to Re-scan Dependencies

Sometimes, forcing a revalidation can trigger proper cleanup:

  1. In Studio:
  • Go to Design → Manage Packages
  • Click Repair Dependencies
  • Then run Remove Unused Dependencies again.
  • Save and reopen project.

This sometimes catches older or stale references.

Thanks,
Please kindly check and let me know if any of the above suggestion worked for you.

Hello @Mikkelagn

Perhaps some of the dependencies of your dependencies are being used.
Try and unfold the dependency and check for full blue icons.

Regards
Soren