Unity导出Xcode iOS构建启动崩溃:UnityFramework依赖缺失求助
Let’s break down what’s happening here — your app can’t find the FBLPromises.framework at launch, which is a dependency usually pulled in by third-party SDKs like Firebase or Facebook SDK in your Unity project. Since Android works fine, the issue is definitely iOS-specific framework embedding or path configuration in Xcode. Here’s how to fix it step by step:
Step 1: Verify the Framework Exists in Xcode Project
- Open your Unity-exported Xcode project. In the Project Navigator, check the
Frameworksfolder forFBLPromises.framework.- If it’s missing: Go back to your Unity project and confirm any third-party SDKs (like Firebase, Facebook) have their iOS dependencies properly installed. You might need to re-import the SDK’s Unity package to ensure all required frameworks are included in the export. If that still fails, you can manually add the framework to Xcode by right-clicking the
Frameworksfolder →Add Files to "[Your Project Name]"and selecting the framework from your SDK’s iOS directory.
- If it’s missing: Go back to your Unity project and confirm any third-party SDKs (like Firebase, Facebook) have their iOS dependencies properly installed. You might need to re-import the SDK’s Unity package to ensure all required frameworks are included in the export. If that still fails, you can manually add the framework to Xcode by right-clicking the
Step 2: Correct the Embed & Sign Configuration
- Select your main app target (not the
UnityFrameworktarget) in Xcode, then switch to the General tab. - Scroll down to
Frameworks, Libraries, and Embedded Content. FindFBLPromises.framework(add it with the+button if it’s missing) and set its Embed option toEmbed & Sign. This ensures the framework is copied into your app bundle and properly signed for iOS.
Step 3: Check UnityFramework Target Settings
- Now select the
UnityFrameworktarget and go to the Build Phases tab:- Under
Link Binary With Libraries, confirmFBLPromises.frameworkis listed. If not, click+and add it. - Under
Embed Frameworks, make sureFBLPromises.frameworkis included. This ensures the framework is embedded within the UnityFramework bundle, which is what your app references at launch.
- Under
Step 4: Address Virtual Machine-Specific Issues
Since you’re running macOS Catalina in a VirtualBox VM, there can be hidden caching or permission problems:
- Clean your Xcode project: Press
Cmd+Shift+Kto clean the build, thenCmd+Option+Shift+Kto delete the entire build folder. - Restart Xcode and your VM to clear any lingering cache.
- Double-check that the folder containing your Xcode project has read/write permissions (right-click the folder →
Get Info→ ensure your user account hasRead & Writeaccess).
Step 5: Validate SDK-Unity Compatibility
Even though you upgraded to Unity 2019.4.2f (a LTS version), some third-party SDKs might have version mismatches. For example, Firebase SDKs require specific versions to work with Unity 2019.x. Check the documentation of your used SDKs to confirm they support Unity 2019.4, and update to the compatible SDK version if needed before re-exporting from Unity.
After going through these steps, rebuild your Xcode project and deploy it to an iOS device — the crash should be resolved if the framework is properly embedded and referenced.
内容的提问来源于stack exchange,提问作者Jonaswinz

