Common error messages: "You can't uninstall this package because components in your org reference it." or "Uninstall failed due to unresolved reference."
Components you created outside the package — such as custom fields, Flows, Process Builders, custom buttons, or Apex classes — may reference objects or fields from the managed package. Salesforce prevents uninstall until all such references are removed.
Deleted records or components in your Recycle Bin may still hold references to package objects. The uninstall process checks the Recycle Bin for references and fails if any are found.
The user performing the uninstall must have the Download AppExchange Packages permission. Without it, the uninstall option is not available.
/lightning/o/RecycleBin/home).Use one of the following methods to identify what is referencing the package:
SELECT MetadataComponentName, MetadataComponentType, RefMetadataComponentName FROM MetadataComponentDependency WHERE RefMetadataComponentNamespace = 'NAMESPACE'Once dependencies are identified:
If the dependency view shows no references but the uninstall still fails, the org may have a "bad reference" — an orphaned metadata reference that cannot be removed through the UI. In this case:
sf package:uninstall. This may succeed in cases where the UI uninstall fails, though dependency errors still apply. Contact Salesforce Support if CLI uninstall also fails.Uninstall a Managed Package — Salesforce HelpKB 000385399 — Remove Components from a Managed Package
005388258

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.