Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by psykojello2 · Jan 29, 2016 at 10:47 PM · iosunity cloud build

Unity Cloud Build. How to set ENABLE_BITCODE for iOS?

My project was building fine until today on Unity Cloud build. Not sure what changed. I'm using Unity 5.1.3f and the cloud project is set to using "Latest version of Xcode".

 16097:        [xcode] ld: '/BUILD_PATH/xxxxxx.xxxxxx.default-ios/temp.IQkMVM/Libraries/libiPhone-lib.a(GameCenter.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. for architecture arm64 16098:        [xcode] clang: error: linker command failed with exit code 1 (use -v to see invocation) 16099:        [xcode] ** BUILD FAILED **

I know how to disable this flag in XCode, but how do I do it in Unity/Cloud build so that ENABLE_BITCODE is set to FALSE?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image psykojello2 · Jan 31, 2016 at 05:44 PM 0
Share

Edit. I thought ENABLE_BITCODE was supposed to be set to True, but it was supposed to be set to false. I'm not sure why this problem cropped up, but I figured out a solution for it. Added an answer.

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by psykojello2 · Jan 31, 2016 at 06:44 PM

I'm not sure why this suddenly stopped working, but i fixed it using a post build script.

Note that I ran into another error when uploading the .ipa file to iTunesConnect: “Invalid Bundle. iPad Multitasking support requires these orientations: ‘ UIInterfaceOrieentationPortrait,UIInterfaceOrientationPortraitUpsideDo........."

Added a fix to the info.plist at the end of this post build function:

 using UnityEngine;
 using UnityEditor;
 using UnityEditor.Callbacks;
 using System.Collections;
 using UnityEditor.iOS.Xcode;
 using System.IO;
 
 public class BL_BuildPostProcess 
 {
 
     [PostProcessBuild]
     public static void OnPostprocessBuild(BuildTarget buildTarget, string path) 
     {
         
         if (buildTarget == BuildTarget.iOS) 
         {
             string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
             
             PBXProject proj = new PBXProject();
             proj.ReadFromString(File.ReadAllText(projPath));
             
             string target = proj.TargetGuidByName("Unity-iPhone");
             
             proj.SetBuildProperty(target, "ENABLE_BITCODE", "false");
             
             File.WriteAllText(projPath, proj.WriteToString());
             
             
             
             // Add url schema to plist file
             string plistPath = path + "/Info.plist";
             PlistDocument plist = new PlistDocument();
             plist.ReadFromString(File.ReadAllText(plistPath));
             
             // Get root
             PlistElementDict rootDict = plist.root;
             rootDict.SetBoolean("UIRequiresFullScreen",true);
             plist.WriteToFile(plistPath);
         }
     }
 }
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MarkusFiredrill · Sep 14, 2021 at 03:06 PM 0
Share

Here is an official post form Unity Support about it https://support.unity.com/hc/en-us/articles/207942813-How-can-I-disable-Bitcode-support-

avatar image
0

Answer by hexagonius · Jan 30, 2016 at 02:01 PM

Looks like 5.3.2 addresses the issue:

https://unity3d.com/unity/whats-new/unity-5.3.2

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image psykojello2 · Jan 30, 2016 at 07:16 PM 0
Share

Tried building with 5.3.2 on cloudbuild and I got the same error.

I know there's a way to run a postbuild to set this flag, but I can't find an example of usage.

avatar image EddieOffermann · Mar 07, 2017 at 06:20 AM 1
Share

A year later, I know, but for the curious folks who stumble on this looking for an answer to their problem:

5.3.2 addressed this issue - but not in a way that was meant to solve it. Unity is complying with Apple's guidelines and encouraging their users to take additional steps if they want not to comply. Think of it like a safety switch - ins$$anonymous$$d of an "enable bitcode" switch somewhere, they're making it so you have to take extraordinary steps to turn bitcode support off.

I'd prefer a checkbox hidden in Player Settings somewhere, but I'm using a script similar to the above for cloud builds these days.

I encounter this problem continually with two packages: Vuforia and ffmpeg. (And for other things that include ffmpeg). OpenCV also presents this problem.

Apple wants things submitted with bitcode enabled. They've suggested that they will eventually not allow apps to be submitted which don't contain bitcode - and indeed watchOS and tvOS already require it. It basically allows them to recompile relevant portions of your project as new OS releases and various devices demand. PTC has their own reasons for not supporting bitcode yet. ffmpeg will support it by including a couple additional flags to build with bitcode in the config.

 --extra-cflags=-fembed-bitcode --extra-cxxflags=-fembed-bitcode

If you search online for "ffmpeg" and that line above, you'll find several discussions with a more complete suggested build config.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

39 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

UnityCloudBuildProjectId not set in info.plist (iOS) 0 Answers

How easily can you build and create a scene in Unity Cloud and run it on a native Xcode project? 0 Answers

Unity Cloud Build. Player export failed.Reason: 'pod' command not found; 2 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

iOS Unity Cloud Build failed when 'Target minimum iOS version' is set to 9 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges