FBLPromises.framework does not contain bitcode - failing build
Asked Answered
S

2

5

I get the following error, even after setting Bitcode to No in my Podfile. This occurs across different Xcode, up to 14.0 (at which I get a signing error, which also doesn't make sense since I have set up development teams on all targets):

Error (Xcode): '/Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/PromisesObjC/FBLPromises.framework/FBLPromises' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/PromisesObjC/FBLPromises.framework/FBLPromises' for architecture arm64

When I set enable bitcode to YES, I get other errors....and it seems on SO, most are recommending to set to NO.

Thoughts on this? It seems specific to this particular framework.

Skywriting answered 7/7, 2022 at 21:22 Comment(2)
I had to set Bitcode to 'No' as docs it's deprecated in Xcode 14.Fennie
seem like need to upgrade Facebook SDK 15+ to prevent bitcode issueEosinophil
C
18

Xcode Setting

I had to enable this settings on my "Pods" Xcode project. Than the error vanished. I'm just wondering why it was set to "No"... Usually I have all settings to create a bitcode enabled build.

Companionate answered 16/7, 2022 at 10:38 Comment(3)
Thanks, I keep adjusting dependng on errors! Any downsides from keeping yes?Skywriting
I had to set Bitcode to 'No' as docs it's deprecated in Xcode 14.Fennie
I am not sure how I got here, because my error was not related(from the error message), but this fixed my issues.Vitiligo
D
0

Apple have deprecated Bitcode beginning with Xcode 14 hence libraries began disabling bitcode in their builds:

Deprecations:

Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14.

Xcode no longer builds bitcode by default and generates a warning message if a project explicitly enables bitcode: "Building with bitcode is deprecated. Please update your project and/or target settings to disable bitcode." The capability to build with bitcode will be removed in a future Xcode release. IPAs that contain bitcode will have the bitcode stripped before being submitted to the App Store. Debug symbols can only be downloaded from App Store Connect / TestFlight for existing bitcode submissions and are no longer available for submissions made with Xcode 14. (86118779)

To resolve this you need to disable bitcode, as shown in the other answer.

If you're using unity and need to do this via code:

https://github.com/firebase/firebase-unity-sdk/issues/556#issuecomment-1346130398

using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using System.IO;
using UnityEditor.Build.Reporting;

public class PostBuild {
    
    [PostProcessBuild(45)]
    private static void OnPostProcessBuildCocoaPodsAdjustments(BuildTarget buildTarget, string pathToBuiltProject)
    {
        if (buildTarget != BuildTarget.iOS) return;
        
        // https://stackoverflow.com/a/51416359
        var content = "\n\npost_install do |installer|\n" +
                                "installer.pods_project.targets.each do |target|\n" +
                                "  target.build_configurations.each do |config|\n" +
                                $"    config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '{PlayerSettings.iOS.targetOSVersionString}'\n" +
                                // https://mcmap.net/q/216011/-xcode-14-needs-selected-development-team-for-pod-bundles
                                $"    config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'\n" +
                                "    config.build_settings['ENABLE_BITCODE'] = 'NO'\n" +
                                "  end\n" +
                                " end\n" +
                                "end\n";

        using var streamWriter = File.AppendText(Path.Combine(pathToBuiltProject, "Podfile"));
        streamWriter.WriteLine(content);
    }


    [PostProcessBuild]
    private static void OnPostProcessBuildDisableBitCode(BuildTarget buildTarget, string pathToBuiltProject)
    {
        if (buildTarget != BuildTarget.iOS) return;

        string projPath = pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj";

        var pbxProject = new PBXProject();
        pbxProject.ReadFromFile(projPath);
        
        // Main
        string target = pbxProject.GetUnityMainTargetGuid();
        pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");


        // Unity Tests
        target = pbxProject.TargetGuidByName(PBXProject.GetUnityTestTargetName());
        pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");


        // Unity Framework
        target = pbxProject.GetUnityFrameworkTargetGuid();
        pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");


        pbxProject.WriteToFile(projPath);
    }
}
Disapproval answered 30/3, 2023 at 5:43 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.