enter image description hereHi there, i am tring to create an unlocked package with skip validation command. after creating the package while installing i am an error

package.xml cannot be a component in managed or unmanaged package

any ideas why it is happening?

  • Have you not removed a colon between "package.xml" and "cannot be a component..."? I'm not so sure the error wants to refer to "package.xml" as the wrong element. Is there not something missing in the screenshot of the HTML?! Could you try to install this package via CLI force:package:install and see the error message there? Commented Feb 10, 2022 at 16:00
  • yeah, i have tried but that is not worked......but i ahve doubt here--------while installing the package we have an option to see what are components available in the package right, but in my unlocked pacakge there are no components present even though i have components the source folder..do you had any idea about this... Commented Feb 11, 2022 at 9:20
  • What source folder are you referring to?! Have you used sfdx force:mdapi? Don't! (If you indeed managed to package package.xml (as sfdcfox deemed possible), your whole approach is wrong.) If you have a standard setup for your unlocked package, you should have a folder hierarchy like [your project]/force-app/main/default - and your sources in sub folders of this default folder. Commented Feb 11, 2022 at 10:20
  • same path...force-app/main/default........."path": "force-app", code snip from project.json Commented Feb 11, 2022 at 11:08

1 Answer 1


Unlocked Packages do not use a package.xml. If you have such a file, remove it from the Unlocked Package directory, and build a new version. It's also generally recommended you don't skip metadata validation without good cause, because that makes it possible to build bad packages. In addition, you cannot promote a package that has skipped validation, meaning you could not install it in production anyways.

  • I am trying to build a POC with unlocked package, so i am skipping validation. any how i will try deleting manifest folder and tyr creating again... Commented Feb 11, 2022 at 9:15
  • you are suggesting to remove manifest folder before creating the package..? Commented Feb 11, 2022 at 9:24
  • @VenkateshKodati There shouldn't be a package.xml to remove. Like I said, Unlocked Packages do not use a package.xml, so there should not be such a file anywhere in your Unlocked Package directory. Where is your manifest directory relative to your Unlocked Package directory?
    – sfdcfox
    Commented Feb 11, 2022 at 12:37
  • The whole scenario is, i am taking a small part of my Application as a modular package where i need to select few LWC components and their respective classes, object and remaining stuff. So inorder to retrive them from my sandbox i have created xml packege retreived the code and components to vs code. From that i have created a unlocked package &trying to install..this is the error i am getting while installing. Commented Feb 11, 2022 at 12:45
  • pls help me out or give me a path to create a package... Commented Feb 11, 2022 at 12:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .