22

I want to build my app with Bitcode enabled. As far as I know all my 3rd party library dependencies are Bitcode enabled. But when I do a build, I get this error:

ld: -bundle and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together

How do I fix this?

Robert Atkins
  • 23,528
  • 15
  • 68
  • 97

1 Answers1

30

I had erroneously set my DEBUG and TEST configurations to build with Bitcode, and this was what caused the above error. Enabling Bitcode only for RELEASE fixed it:

enter image description here

(Your App and any embedded framework targets should look like this—don't enable Bitcode at all on your test and UI testing targets.)

Robert Atkins
  • 23,528
  • 15
  • 68
  • 97
  • Setting "Enable Bitcode" to "No" for the Unit Test Build target solved it. Thanks! – Awsed Feb 15 '16 at 10:31
  • 7
    I faced this error when launching on a device, although on Simulator this error does not appear – schmidt9 Oct 20 '16 at 08:10
  • If you don't see `Enable Bitcode`, check that `BaseSDK` is correctly set to `iOS` (or whatever platform you're using). – McKinley Mar 03 '22 at 23:16
  • Did you ever have this issue in release mode? I'm building OpenSSL 3 in release mode and get this exact problem. I need bitcode, though. What is the other one, `-bundle`? – JonasVautherin Jul 08 '22 at 12:06
  • I don’t recall, sorry. Bitcode is deprecated as of Xcode 14 though, so if you can wait long enough your problem will just go away . – Robert Atkins Jul 09 '22 at 14:11