16 votes

Second gen package error about a component being a scratch org ancestor? What does this mean?

I just ran into the same issue. Trying to install my namespaced package into a scratch org with the same namespace. You need to create a scratch org without a namespace using the --nonamespace flag ...
RockPile's user avatar
  • 303
10 votes
Accepted

2GP: How to set Managed Package Publisher Name

It is the company Name in your DevHub org that is used for App publisher name. Navigate to the Set up > Company Profile > Company Information in your DevHub and next package you generate will ...
Mohith Shrivastava's user avatar
9 votes
Accepted

Converting First Generation Managed Package to Second Generation (2GP) Packages

November 2020 Answer Converting from 1GP to 2GP is in Developer Preview in the Winter '21 (Oct 2020) release. You can join the Partner Community group which has all of the instructions for getting ...
daveespo's user avatar
  • 2,603
7 votes
Accepted

2GP Source Push Error: The consumer key is already taken

The best practice is to package up your connected app along with the other components in 2GP. Now the way you package up the Connected App in 2GP is different, I will go down the steps here, Create a ...
Mohith Shrivastava's user avatar
7 votes
Accepted

How are global classes and/or components treated in 2nd Generation Packaging (unlocked and managed)

Unlocked Packages For Unlocked packages, you can revert a class from global to public or even to private and it should allow you to do it fine because it simply does not matter. 2GP Managed Packages ...
Mohith Shrivastava's user avatar
7 votes

fflib as Second Generation Managed Package (2GP)

I'll start this answer by recognizing that questions which solicit opinions, rather than objective answers, are frowned upon on StackExchange. Having said that, the question was framed beautifully and ...
Vivek M. Chawla's user avatar
6 votes
Accepted

Nested Unlocked Packages requires Installation of Base Packages?

After carefully checking the JSON source, I realized that the dependencies were out of order. You must list the dependencies in the order that they depend upon each other. In other words, the (...
sfdcfox's user avatar
  • 491k
5 votes

'ParentId' field missing when deploying ExperienceBundle - 2GP

If you have enabled the ExperienceBundle Metadata API in the Dev Hub and you're still getting this error, remove the <networkMemberGroups> from the Network file of your Community. Due to a bug ...
TheLeonKing's user avatar
5 votes

Type.forName(..) returns null for Unlocked Package with Spring 20' release

This is part of the critical update documented here https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_apex_publicConstructorsInMgdPackages.htm?edition=&impact= Specifically ...
thegogz's user avatar
  • 368
5 votes
Accepted

2GP Managed Package: Admin Profile changes

I do not recommend using Custom Profiles in managed package (except if you are distributing the app as OEM app) as it requires a Mapping during installation which is an additional step that admins may ...
Mohith Shrivastava's user avatar
5 votes

Is there any way to implement a smooth customer migration from 1GMP to 2GMP?

I build 2GMP for client who has many customers installed their previous 1GMP version of the package. Respectfully, you and your client have made a strategic error here. It would've been far cheaper ...
David Reed's user avatar
  • 92.8k
5 votes

fflib as Second Generation Managed Package (2GP)

G'day folks. Apologies for being a bit late to this discussion. @lightxx -- There are pros and cons about separating the fflib classes out to a new package. All things being equal, it makes sense to ...
ImJohnMDaniel's user avatar
4 votes
Accepted

How to Upgrade Second-Generation (2GP) Unlocked Package to Second-Generation (2GP) Managed Package

I have not tried this, but I don't think you could do. The Salesforce DX Developer Guide: Generate the Package Says: You can’t change the package namespace or package type after you create the ...
arut's user avatar
  • 5,281
4 votes
Accepted

Guidelines on the process of converting the first generation manage package to second generation manage package

First, some definitions: Developer Edition Org A Developer Edition (DE) Org is used for development of personal projects and AppExchange products using First Generation Managed Packaging (1GMP). ...
sfdcfox's user avatar
  • 491k
4 votes

Anyone having problems creating a scratch org / promoting a package version today (Aug 12, 2020)? I seem to be getting Winter '21 orgs!

This was a bug that Salesforce corrected.
Vincent Ip's user avatar
4 votes
Accepted

Second-Gen Packaging Migration and Winter 21 release

For 1 and 2nd items, the work is in progress and cannot publicly disclose the dates. I recommend you reach to your partner account manager or if you are an ISV reach to your ISV Technical Evangelist ...
Mohith Shrivastava's user avatar
4 votes

Second-Generation Managed Package Security Review

The future is here - the Winter '20 release will make Second Generation Managed Packages (2GP) publicly available and you'll be able to submit them for security reviews and publish on the AppExchange.
Brian Miller's user avatar
  • 5,212
4 votes
Accepted

Second-Generation Managed Package Security Review

As this mechanism is still beta (I added the bolding here): As a beta feature, Second-Generation Managed Packages is a preview and isn’t part of the “Services” under your master subscription ...
Keith C's user avatar
  • 136k
4 votes
Accepted

Can 2GP Packages be deleted?

At this point, no. Packages, and package versions, cannot be deleted. There's an Idea you should go vote on. Note that you can deprecate packages, which does help with accidentally installing wrong ...
sfdcfox's user avatar
  • 491k
4 votes
Accepted

How to use second generation packaging (2GP) for a community?

The packaging for a second-generation package takes place in a "behind-the-scenes" scratch org that Salesforce calls a build org. That build org needs to be configured with the right ...
David Reed's user avatar
  • 92.8k
4 votes
Accepted

System.requestVersion() does not work in Second Generation Packaging

After contacting Salesforce, I had confirmation that Version is, to this day, not supported in 2GP, which caused the issue described here. Update Oct.2021: still not supported. The "least worst&...
Louis Bompart's user avatar
4 votes

2GP Managed Package: Admin Profile changes

No, you can't modify the System Administrator profile. Yes, custom Profile or Permission Set for managing the perms your package needs.
Brand0R's user avatar
  • 1,054
4 votes
Accepted

How to Fix Security Violation AvoidGlobalModifier in a Promoted 2GP Managed Package for the Security Review

If you're working on a 1GP, you simply need to: Ensure the version(s) of the package containing the spurious global modifiers are not installed anywhere, Raise a Salesforce Support case to ask for ...
Phil W's user avatar
  • 36.2k
3 votes
Accepted

Solving error about NavigationLinkSet when packaging a community using 2GP

Communities are not packageable for 2GP packages. As an unlocked package yes you can package up the ExperienceBundle (there are some known issues with ExperienceBundle as well on known issue site so ...
Mohith Shrivastava's user avatar
3 votes

'ParentId' field missing when deploying ExperienceBundle - 2GP

After a painful 2 week trial and error dance with Salesforce Support (Case: #26307915), we learned that we have to do something very unintuitive. It's a setting in the Dev Hub org which needs to be ...
Anmol Kumar's user avatar
  • 3,629
3 votes
Accepted

2GP: Dependent class is invalid and needs recompilation

I got rid of the errors: Dependent class is invalid and needs recompilation By adding --definitionfile config/project-scratch-def.json to the command: sfdx force:package:version:create --package &...
Robs's user avatar
  • 9,336
3 votes
Accepted

2GP: ERROR running force:package:version:create: MyApp: Installing an app (MyApp) that has been deleted

This is because you have a Connected Apps source in your 2GP package. There is a unique way to package this up and I have answered it here Get rid of the Connected Apps file from your project ...
Mohith Shrivastava's user avatar
3 votes
Accepted

2GP: Package upgrade from patch to next minor version

Scenario 1 - 1.2.1.0 as your ancestor for the next minor release i.e 1.3.0.0 Let's consider the scenario if you specify 1.2.1.0 as your ancestor for the next minor release i.e 1.3.0.0 In this ...
Mohith Shrivastava's user avatar
3 votes
Accepted

Error when generating package version with values in account standard picklist

The Special Behavior of Components in Packages documentation states that: Changes to standard picklists can’t be packaged and deployed to subscriber orgs and picklist values deleted by the developer ...
Renato Oliveira's user avatar
3 votes

Error when generating package version with values in account standard picklist

This is a known issue in Salesforce. The root cause is that the StandardValueSets are not supported by 2GP but have somehow been added to the package due to a bug in packaging. You can check the ...
Alok Agrawal's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible