fix: iOS app crash at startup #762
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for proposing a pull request!
To help us review the request, please complete the following:
bugfor bug fixes)Pull Request Details
Before this change:
Facebook SDK .xcframeworks were not explicitly added to the Unity iOS build output.
This sometimes caused missing framework references in Xcode, leading to build errors or runtime crashes when the app attempted to use Facebook SDK functionality.
After this change:
Added a PostProcessBuild step to automatically include the required Facebook .xcframeworks (FBAEMKit, FBSDKCoreKit, FBSDKCoreKit_Basics, FBSDKGamingServicesKit, FBSDKLoginKit, FBSDKShareKit) in the Xcode project.
Ensures these frameworks are both added to the build and embedded in the app bundle for runtime access.
The script targets the UnityMainTarget to insert framework references directly into the generated Xcode project.
Test Plan
Build the Unity project for iOS.
Open the generated Xcode project.
Verify the Facebook .xcframeworks appear in Frameworks, Libraries, and Embedded Content under the Unity iOS target.
Confirm that “Embed & Sign” is set for each framework.
Run the app on a physical iOS device and verify that Facebook SDK features load without causing runtime crashes.