I'm working on a SFDX package within a project that has no dependencies. Every time I create a package version, it fails with the following error:
ERROR running force:package:version:create: Hed__course_enrollment__c.Default: Not in package.xml,Course_enrollment__c.Default: Not in package.xml,Case.DefaultProcess: Not in package.xml,Case.Default: Not in package.xml,Account.Default: Not in package.xml
My package has no external dependencies, and my scratch JSON file does not reference these files... This error started appearing when I tried to create a package version for a different package version in a different package. However, now I cannot create any package versions...
Can someone please point me to any steps I can follow to resolve this error?
More details below:
I had been working with a Salesforce unlocked package directory, trying to create a package version for a package with a dependency on Salesforce EDA. During that investigation (see this question for details), I made the following change to my project-scratch-def.json file:
{
"orgName": "Destiny Solutions",
"edition": "Developer",
"features": ["RecordTypes"],
"objectSettings": {
"account": {
"defaultRecordType": "default"
},
"case" : {
"defaultRecordType": "default"
},
"hed__course_enrollment__c": {
"defaultRecordType": "default"
}
}
}
This caused a subsequent call to sfdx force:package:version:create
to fail with the following error:
ERROR running force:package:version:create: Course_enrollment__c.Default: Not in package.xml,Hed__course_enrollment__c.Default: Not in package.xml
After that failure, I created a branch new SFDX project with no dependencies and a single package. My project json and scratch json files are given below:
{
"packageDirectories": [
{
"path": "contact",
"default": true,
"package": "DSConnectContact",
"versionName": "Release 5.3.0",
"versionDescription": "Destiny Connect Salesforce Reference for Contacts - 5.3.0",
"versionNumber": "5.3.0.NEXT",
"definitionFile": "config/project-scratch-def.json"
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "49.0",
"packageAliases": {
"DSConnectContact": "0Ho4W000000k9gJSAQ"
}
}
{
"orgName": "Destiny Solutions",
"edition": "Developer",
"features": [],
"settings": {
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
},
"securitySettings": {
"passwordPolicies": {
"enableSetPasswordInApi": true
}
},
"mobileSettings": {
"enableS1EncryptedStoragePref2": false
}
}
}
sfdx force:package:version:create --package 0h0XXX -f /config/definitionFile -k PASSWORD --wait 30
sfdx force:package:version:create -p [packagename] -k [installationKey]
sfdx force:package:version:create -p [packagename] -k [installationkey] -w 30 -f config\project-scratch-def.json
still fails with the same error I've mentioned in my question.. I have found however that if I do not specify a project configuration file (no -f parameter) and remove"definitionFile": "config/project-scratch-def.json"
from my project config then I can publish a version... but that also means I can no longer override package settings via a file...