Skip to main content
Support
Search our knowledge base

How can I disable Bitcode support?

Comments

5 comments

  • Tom Kane

    This was really useful, thanks. We were having issues with our iOS build and this has fixed it.

    0
  • Andrey Dolgov

    Doesn't work on compiling in Cloud Build:

    error CS0234: The type or namespace name 'Callbacks' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
    error CS0234: The type or namespace name 'iOS' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
    error CS0246: The type or namespace name 'BuildTarget' could not be found (are you missing a using directive or an assembly reference?) error CS0246: The type or namespace name 'PostProcessBuildAttribute' could not be found (are you missing a using directive or an assembly reference?) error CS0246: The type or namespace name 'PostProcessBuild' could not be found (are you missing a using directive or an assembly reference?)

    Is there a way to configure Cloud Build to disable bitcode?

    0
  • Edd Smith

    Andrey Dolgov - My guess would be that you've not put the script in an Editor folder which is why it can't find those classes.

    0
  • Elizeu Emanuel Herichs Becker

    Doesn't work in 2019.3, xcode doesn't even give you the option to disable bitcode manually.

    I'm using:

    Unity 2019.3.15

    Xcode 11.5

    iOS 13.5

    I'm trying to build an app with easyAR but it always give me this:

    /Frameworks/Plugins/iOS/easyar.framework/easyar(easyar-arm64-master.o)' 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.

    I tried going to the file that it points to and add ENABLE_BITCODE (tried NO and YES) to the Info.plist of the framework but no success.

    Tried all of this in two projecs, one with firebase (generates xcworkspace) and another with easy ar only (generates xcodeproj), both had the same error.

    0
  • Nurullah Morshed

    Elizeu Emanuel Herichs Becker

    The code shown here no longer works due to the way Unity has changed the targets in xcode in Unity 2019.3 and later.

    I made this modification to the code to get it working again.

     

    #if UNITY_IOS
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEditor;
    using UnityEditor.Callbacks;
    using UnityEditor.iOS.Xcode;


    public static class MyBuildPostprocess
    {
    [PostProcessBuild( 1000 )]
    public static void PostProcessBuildAttribute( BuildTarget target, string pathToBuildProject )
    {
    if(target == BuildTarget.iOS)
    {
    string projectPath = PBXProject.GetPBXProjectPath(pathToBuildProject);

    PBXProject pbxProject = new PBXProject();
    pbxProject.ReadFromFile(projectPath);
    string[] targetGuids = new string[2] { pbxProject.GetUnityMainTargetGuid(), pbxProject.GetUnityFrameworkTargetGuid() };

    pbxProject.SetBuildProperty(targetGuids, "ENABLE_BITCODE", "NO");
    pbxProject.WriteToFile (projectPath);
    }
    }
    }
    #endif

     

    1

Please sign in to leave a comment.