pbxProject.prototype.addFramework: automatically create Frameworks Group if it does not exist
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- ios, javascript, nodejs
- Domain
- mobile
Research direction
Start at pbxProject.prototype.addFramework and trace how the Frameworks group and project mainGroup are handled. Use the issue's workaround as the behavioral reference. Done means a missing Frameworks group is both created and referenced by mainGroup, so Xcode does not place the framework in Recovered References.
Written by the indexing model from the issue text.
Description
This is a feature proposal
Initial Situation:
Your xcode project tree looks like this:

You have a Xcode project without a Framworks group and you want to add a new framework using pbxProject.prototype.addFramework.
Current behaviour:
The Frameworks group is created but not added to the mainGroup of the project which references all files (that are not part of a subgroup) and all groups (that are no subgroups).
If you open the updated xcode project with xcode you see the following:
This is because xcode cannot find a reference to the Frameworks group on the mainGroup and therefore "autofixes" the project by adding the library added with pbxProject.prototype.addFramework to a newly generated group Recovered References.
Expected behaviour:
The Framework group is created and also automatically added to the mainGroup.
When you open the project in xcode it should look like this:
Current workaround:
Add the Frameworks group to mainGroupmanually:
const project = xcode.project(projectPath);
project.parseSync();
project.addFramework(path.resolve(frameworksDirectory, 'GoogleInterchangeUtilities.framework'), {
customFramework: true,
embed: true,
link: true,
});
const mainProject = project.getPBXGroupByKey(project.getFirstProject().firstProject.mainGroup);
if (!mainProject.children.some(children => children.comment === 'Frameworks')) {
const [groupKey] = Object.entries(project.hash.project.objects['PBXGroup']).find(
([, group]) => group.name === 'Frameworks',
);
project.addToPbxGroup(groupKey, project.getFirstProject().firstProject.mainGroup);
}
If you are okay with this feature proposal I would love to implement it!
- Dominant language
- JavaScript
- Stars
- 217
- Forks
- 102
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/cordova-node-xcode
-
Add & Improve JSDocs Openenhancement
apache/cordova-node-xcode#171 · 1 assignee ·
-
🔖 New release Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
apache/cordova-node-xcode#162 · 4 comments · 2 reactions ·
-
Install .xcframework Open
Difficulty 3/5 1-2 days Newbie friendliness 28/100
apache/cordova-node-xcode#139 · 2 comments ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/cordova-node-xcode#138 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/cordova-node-xcode#137 · 2 reactions ·
All issues in apache/cordova-node-xcode
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
web-platform-tests/interop#1455 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
corsairdev/corsair#1764 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100