I need to add a new class to an existing 2GP managed package. I get the following error when I attempt to create the package using the SF CLI. How do I resolve this issue when I attempt to build it?

We couldn’t create this package version because new components were added or existing components were deleted. Remove components {ApexClass=[ckz_PIM_ScheduledCacheRebuild]} from the package version, and create the package version again.


The current managed package that was released was 1.0.2

I modified my sfdx-project.json so that the ancestorId is set to the 1.0.2 package id.

The versionNumber is set to

I still get the same error message when attempting to create the managed package. Any help would be appreciated!

  • Did you set a new target number for the version with appropriate ancestor version?
    – Phil W
    Jun 9 '20 at 20:04
  • @PhilW the previous version was, so I was trying to create Is that the right way to do it? Jun 10 '20 at 0:36

I worked with a colleague on this. The answer was to create the new package version as 1.1.0-1. For some reason, using was not accepted. Having the beta version number be something other than zero was the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.