1

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.

UPDATE

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 1.0.3.0

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 at 20:04
  • @PhilW the previous version was 1.0.2.0, so I was trying to create 1.0.3.0. Is that the right way to do it? – Michael Sobczak Jun 10 at 0:36
1

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 1.0.3.0 was not accepted. Having the beta version number be something other than zero was the answer.

| improve this 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.