Unity IOS Xcode 14.0 Build errors(Bitcode) on IPhone 16.0 OS

Unity IOS build not run on Xcode14.0 with iPhone OS 16.0, before that the build ran successfully. Please see the error when building the project.

error build: '/Users/apple/Library/Developer/Xcode/DerivedData/Unity-iPhone-akxovnhrzbzzdzgorkwgbiqtjebo/Build/Products/ReleaseForRunning-iphoneos/libPods-UnityFramework.a(Pods-UnityFramework-dummy.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. file '/Users/apple/Library/Developer/Xcode/DerivedData/Unity-iPhone-akxovnhrzbzzdzgorkwgbiqtjebo/Build/Products/ReleaseForRunning-iphoneos/libPods-UnityFramework.a' for architecture arm64

Answered by fortunex in 728118022

In my case I changed "Enable Bitcode" to "true" for the "Pods-Unity-iPhone" Target and it works.

I guess you need to change "Enable Bitcode" to "true" for the right target and it should work.

Your error message says you must do one of:

rebuild it with bitcode enabled.

obtain an updated library from the vendor.

disable bitcode for this target.

When you tried those 3 solutions, what was the outcome?

we try these 3 solutions but get the same results and same outcome. we also delete the DataDrive folder and try with enabled_bitcode = no, then build again but get the same result.

Apparently we have to enable bitcode for the Pods project. I tested that and it works for me.

As I said, option 1:

rebuild it with bitcode enabled

error build: '/Users/apple/Library/Developer/Xcode/DerivedData/Unity-iPhone-akxovnhrzbzzdzgorkwgbiqtjebo/Build/Products/ReleaseForRunning-iphoneos/libPods-UnityFramework.a(Pods-UnityFramework-dummy.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. file '/Users/apple/Library/Developer/Xcode/DerivedData/Unity-iPhone-akxovnhrzbzzdzgorkwgbiqtjebo/Build/Products/ReleaseForRunning-iphoneos/libPods-UnityFramework.a' for architecture arm64

Accepted Answer

In my case I changed "Enable Bitcode" to "true" for the "Pods-Unity-iPhone" Target and it works.

I guess you need to change "Enable Bitcode" to "true" for the right target and it should work.

I had to enable Bitcode on all targets of the Pods project. That's pretty annoying.

Bitcode is now deprecated: https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes

Better option is to just disable bitcode in your main project and that should fix the issues with all the dependencies as well.

  1. The above solution of Disabling Bitcode works,

  2. but since I have multiple layers of setting as my xcode project was generated by unity engine, the first few error was solved, yet it failed at around step 905 of 955,

  3. and the solution is all bit code enabled should be set to no, meaning you should navigate to build target and check setting of unityframework, unity-iphone, game assembly and unity-iphone test also have the correct setting, as changing one doesn't mean other are changed accordingly.

Unity IOS Xcode 14.0 Build errors(Bitcode) on IPhone 16.0 OS
 
 
Q