I am working in a scratch org, developed the package. Everything is working fine.
I created the package.
Then when I go to create the package version it always fails on Unknown types for the dependencies....
in the sfdx-project.json I have:
{
"packageDirectories": [
{
"path": "force-app",
"default": true,
"package": "Package Name",
"versionName": "ver 0.1",
"versionNumber": "0.1.0.NEXT"
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "43.0",
"dependencies": [
{
"package": "[email protected]" // also tried the package name@ver as listed in the installed packages of the org
//also tried this and it gets the same error
"subscriberPackageVersionId" : "04t......"
},
{
"package": "package alias",
"versionNumber": "0.1.0.LATEST" //also tried removing this and using alias@version and 04t id in the package field
}
],
"packageAliases": {
"Package Alias": "0Hoxxxx"
}
}
Note I have replaced actual names with aliases.
The CLI I am using is:
sfdx force:package:version:create --package "Package Name"
--installationkeybypass -w 10
The First dependency is a 1st gen managed package.
The Second dependency is a 2GP (Unlocked no namespace) in the Dev Hub org. I have tried a field of "subscriberPackageVersionId" with the 04t Id, the 04t Id with the current field, and various other combinations.
The DevHub org has all the required packages installed in case that matters
Any ideas on how to properly state the dependencies to get the version created?
Note Deploying the classes directly to the production org (also dev hub org) works just fine.
According to the docs: it says "To specify dependencies for 2GP outside of the Dev Hub and for first-generation packages within or outside of the current Dev Hub, use......."
When attempting to create a package version I get the following first error:
Invalid type: ns__XXXXX__c Class Name: DML requires SObject or SObject list type: ns__XXXXX__c <- this is the SObject from the 1GP
(Tests are all good and passing in the scratch org in which I am working.)
The rest of the errors are cascading due to the first error.
ANSWER The table located HERE did not make it clear which parameter was a child or top level. Based on the selected answer it was apparent I had the dependencies object in the wrong spot in the JSON file.