skip to Main Content

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.

2

Answers


  1. 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.

    Login or Signup to reply.
  2. 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 = "nnpost_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://stackoverflow.com/questions/72561696/xcode-14-needs-selected-development-team-for-pod-bundles
                                    $"    config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'n" +
                                    "    config.build_settings['ENABLE_BITCODE'] = 'NO'n" +
                                    "  endn" +
                                    " endn" +
                                    "endn";
    
            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);
        }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search