It seems like it should be simple, but I have googled this and failed.

I'm writing a project using Packaging 2 in sfdx, and it depends on an old managed package. I've installed that package into my scratch org, but now I'm struggling to generate a package.

Here's my sfdx-project.json:

  "packageDirectories": [
      "path": "force-app",
      "id": "0HoXXXX",
      "versionNumber": "",
      "versionName": "Initial",
      "ancestorId" : "05iXXX",
      "versionDescription": "Including Related List",
      "default": true,
      "dependencies": [{"subscriberPackageVersionId": "04tXXXX", "installationKey": "XXX"}]
  "namespace": "xxxx",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "41.0"

When I run

sfdx force:package2:version:create -i 0HoXXX -d force-app/ 

I get the response:

(1) Unable to parse package2-descriptor.json: invalid attribute 'installationKey'

Fair enough, but what is the right attribute for that? I can't find it from the documentation and none of my guesses have worked.


Salesforce have responded to this in the Packaging 2 Beta Trailblazer Community:

Unfortunately what you're describing is a known outage for Packaging 2 right now. We have work in progress to resolve this but it obviously has security implications which need to be carefully vetted.

Link (requires SF login):


I've asked them to add it to the list of known limitations for Packaging 2: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_considerations.htm#package2-considerations

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.