Skip to content

Fix iOS hybrid app archive issue by removing CordovaLib subproject#323

Merged
wmathurin merged 1 commit into
forcedotcom:devfrom
wmathurin:fix-hybrid-ios-archive-issue
Mar 25, 2026
Merged

Fix iOS hybrid app archive issue by removing CordovaLib subproject#323
wmathurin merged 1 commit into
forcedotcom:devfrom
wmathurin:fix-hybrid-ios-archive-issue

Conversation

@wmathurin
Copy link
Copy Markdown
Contributor

When archiving iOS hybrid apps created with forcehybrid.js, Xcode was producing a 'Generic Xcode Archive' instead of an 'iOS App Archive'. This prevented proper distribution of the app.

The issue was caused by CordovaLib being included as a subproject in the generated Xcode project. This commit adds a new function removeCordovaLibFromWorkspace() that automatically removes all CordovaLib references from the project.pbxproj file after cordova prepare runs.

The function removes:

  • PBXContainerItemProxy entries referencing CordovaLib
  • PBXReferenceProxy entries for CordovaLib products
  • PBXTargetDependency entries for CordovaLib
  • PBXFileReference for CordovaLib.xcodeproj
  • Products group and projectReferences entries
  • All array references to removed IDs

This fix is only applied to iOS platform builds and ensures the generated apps can be properly archived for distribution.

When archiving iOS hybrid apps created with forcehybrid.js, Xcode was
producing a 'Generic Xcode Archive' instead of an 'iOS App Archive'.
This prevented proper distribution of the app.

The issue was caused by CordovaLib being included as a subproject in
the generated Xcode project. This commit adds a new function
removeCordovaLibFromWorkspace() that automatically removes all
CordovaLib references from the project.pbxproj file after cordova
prepare runs.

The function removes:
- PBXContainerItemProxy entries referencing CordovaLib
- PBXReferenceProxy entries for CordovaLib products
- PBXTargetDependency entries for CordovaLib
- PBXFileReference for CordovaLib.xcodeproj
- Products group and projectReferences entries
- All array references to removed IDs

This fix is only applied to iOS platform builds and ensures the
generated apps can be properly archived for distribution.
Copy link
Copy Markdown
Member

@bbirman bbirman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally too

@wmathurin wmathurin merged commit 2f5c824 into forcedotcom:dev Mar 25, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants