2

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!

2
  • Did you set a new target number for the version with appropriate ancestor version? Commented Jun 9, 2020 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? Commented Jun 10, 2020 at 0:36

1 Answer 1

3

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.

1
  • I am seeing similar error. Add components {Profile=[Admin]} back into the package version, and create the package version again. This is my current sfdx-project json of managed package : "versionName": "1.2", "versionNumber": "1.2.0.NEXT", "ancestorVersion": "1.1.0.1" And now I am creating new beta package with this: "versionName": "1.3", "versionNumber": "1.3.0.NEXT", "ancestorVersion": "1.2.0.1" any suggestions? Commented Jun 11, 2022 at 2:52

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.