2

I have an iOS application in Swift with CocoaPods using the UrbanAirship iOS SDK via Pods as follows:

pod 'UrbanAirship-iOS-SDK'

We can verify the version installed in the Podfile.lock file:

- UrbanAirship-iOS-SDK (6.2.0):
  - UrbanAirship-iOS-SDK/Core (= 6.2.0)
- UrbanAirship-iOS-SDK/Core (6.2.0)

The application builds, runs and archives properly on Xcode 6.4. In addition, it also builds and runs properly on Xcode 7 beta 6. However, when archiving in Xcode 7, I get the following error:

ld: '.../Pods/UrbanAirship-iOS-SDK/Airship/libUAirship-6.2.0.a(UAWalletAction.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 armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have updated the project build settings to disable bitcode by setting ENABLE_BITCODE to NO, both at the project and target(s) levels, as indicated on this SO answer, but the error persists.

enter image description here

Any help would be appreciated. Thanks for your time.

Community
  • 1
  • 1
Eneko Alonso
  • 18,884
  • 9
  • 62
  • 84
  • can you handle push notification in foreground mode. Please suggest me, how to handle notification in foreground mode. It is required in my iOS application(Swift). – Vipulk617 Sep 11 '15 at 07:36

3 Answers3

8

Yesterday I updated to the latest XCode7 (pre-release) and wasn't able to archive the project I was working on :( ... After struggling to build the UA SDK & other libraries myself, I simply set Enable Bitcode to NO and everything worked as it did in XCode6! :)

Update:

In addition to the project and targets in the project, Bitcode also should be disabled (by setting Enable Bitcode to No) in the CocoaPod framework targets affected (UrbanAirship-iOS-SDK in this case).

enter image description here

Eneko Alonso
  • 18,884
  • 9
  • 62
  • 84
Chris Allinson
  • 1,837
  • 2
  • 26
  • 39
  • Interesting, I tried setting **Enable Bitcode** to **NO**, as I explained in my post, but it still does not work for me, still get the same error. – Eneko Alonso Sep 12 '15 at 20:19
  • Ugh, just realized I had updated the Bitcode setting on all targets in the app, but not on the cocoa pods framework targets. I've updated your answer to reflect this. – Eneko Alonso Sep 14 '15 at 21:37
  • I had the same issue with Firebase library and it helped. Thanks! – Sergei Basharov Sep 17 '15 at 12:25
1

You can safely turn off Enabled Bitcode to NO if your app is not built for Watch OS.

I would also suggest using Xcode 6 to submit builds as most of the libraries won't be adding support for bitcode at least until the official Xcode 7 comes out.

Libraries with bitcode support cannot be run on Xcode 6, hence the delay in adoption.

Gautam Jain
  • 2,913
  • 30
  • 25
0

To enable bitcode you have to build the library with Xcode 7. Xcode 7 GM was released today, so it is now possible for us to release an update to the UA SDK with bitcode enabled. Until the update, you can build the SDK from source by following https://github.com/urbanairship/ios-library.

Update: We released 2 builds of 6.2.2, one with bitcode and one without. https://bintray.com/urbanairship/iOS/urbanairship-sdk/6.2.2/view

ralepinski
  • 1,756
  • 8
  • 15