17

I just downloaded Xcode 7 beta 4 and am trying to build my Swift 2.0 application but I am getting the following error which I can't figure out the solution to:

ld: warning: -weak_framework is treated as -framework when used with -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES). Weak linking may still happen based on availability mark-up in headers ld: 'path/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(GMSBillingPointRecorder.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 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Does anyone know how to fix this problem?

Pang
  • 9,564
  • 146
  • 81
  • 122
KPath001
  • 870
  • 5
  • 18
  • What version of GoogleMaps framework are you using? – Vlad Papko Jul 26 '15 at 21:45
  • I installed it using cocoa pod and it says it installed google maps 1.10.1 – KPath001 Jul 27 '15 at 04:26
  • 1
    It strange, I created new project in Xcode 7 beta 4, and installed google maps 1.10.1 by cocoa pods. Everything works fine. I will advice to you to create new project and migrate your source files from current project. Also try to change value of ENABLE_BITCODE flag in your project settings. In my case it works with any value (true, false) of this flag. – Vlad Papko Jul 27 '15 at 04:29
  • Alright I'll try that and get back to you.....thank you for the suggestion – KPath001 Jul 27 '15 at 04:30
  • I updated comment, before creating new project, try to change value of ENABLE_BITCODE flag. – Vlad Papko Jul 27 '15 at 04:31
  • I'm a noob here with the new Xcode how would I go about it? – KPath001 Jul 27 '15 at 04:41

4 Answers4

21

Setting ENABLE_BITCODE flag to NO solves the issue.

For those wondering if its safe to disable it. Yes it is.

As per Apple Doc

Bitcode (iOS, watchOS)

Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.

Xcode hides symbols generated during build time by default, so they are not readable by Apple. Only if you choose to include symbols when uploading your app to iTunes Connect would the symbols be sent to Apple. You must include symbols to receive crash reports from Apple.

Note: For iOS apps, bitcode is the default, but optional. If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode. For watchOS apps, bitcode is required.

Bitcode is part of Apple's new effort for App thinning. At the time of this writing, it is optional but could potentially be required later on. I think Apple is giving the frameworks/libs communities time to adapt.

Edit: In Xcode 7 you upload your app to iTunes connect in an intermediate state called Bitcode. When users download your app, the App Store will automatically produce an optimized version of your app (i.e., 64-bit if needed) to match the device the user is using.

For now what we can do is to disable bitcode and wait for Google Maps SDK's update.

UPDATE

SDK 1.11.0 - now supports Bitcode

https://developers.google.com/maps/documentation/ios-sdk/releases?hl=en

Resources:

Impact of Xcode build options "Enable bitcode" Yes/No

https://developer.apple.com/library/prerelease/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html

https://www.hackingwithswift.com/ios9

Community
  • 1
  • 1
Teffi
  • 2,498
  • 4
  • 21
  • 40
  • The issue for GoogleMaps api is tracked here: https://code.google.com/p/gmaps-api-issues/issues/detail?id=8219 , vote for it if you need it. – Mariano Paniga Nov 23 '15 at 15:22
20

I changed the ENABLE_BITCODE Flag to No and compiled properly thanks @Visput for the answer

KPath001
  • 870
  • 5
  • 18
5

Just to be clear where to disable bitcode: Target -> Build Settings -> Enable Bitcode -> No

Disable Bitcode

GIF image is courtesy of @stevechen

nikans
  • 2,468
  • 1
  • 28
  • 35
0

Google has resolved this issue in SDK Version 1.11.0 - December 2015. See the release notes:

Bitcode is now included in the SDK binary for all device architectures. (Issue 8219).

ehhhuang
  • 117
  • 1
  • 3
  • 9