Estimote / iOS-Fleet-Management-SDK

Estimote Fleet Management SDK for iOS
https://developer.estimote.com
MIT License
1.18k stars 398 forks source link

Archiving: Linker command failed #212

Closed aforty closed 8 years ago

aforty commented 8 years ago

Hi, I'm using the latest version of the SDK through cocoapods. When I try to Archive the build (for test flight) the build fails with the following error. Any ideas?

Edit: Using Xcode 7.1

Linker command failed with exit code 1
ld: bitcode bundle could not be generated because '/Users/aforty/Code/simplifeye/Pods/EstimoteSDK/EstimoteSDK/EstimoteSDK.framework/EstimoteSDK(ESTBeaconUpdateConfig.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
martinklimek commented 8 years ago

Hi @aforty, what version of SDK are you using?

heypiotr commented 8 years ago

Yup, can you check your Podfile.lock and make sure you're on SDK 3.7.0 or later? Does doing a full clean (alt+command+shift+K) help?

aforty commented 8 years ago

Hi guys. I appreciate the help!

I'm using the latest available here on git, I pointed cocoa pods to pull from this repo. Let me know if there are any other files I can provide for you.

Podfile.lock

PODS:
  - Alamofire (3.0.0-beta.3)
  - EstimoteSDK (3.7.1)
  - SwiftyJSON (2.3.0)

DEPENDENCIES:
  - Alamofire (from `https://github.com/Alamofire/Alamofire.git`, tag `3.0.0-beta.3`)
  - EstimoteSDK (from `https://github.com/Estimote/iOS-SDK`)
  - SwiftyJSON (from `https://github.com/SwiftyJSON/SwiftyJSON.git`)

EXTERNAL SOURCES:
  Alamofire:
    :git: https://github.com/Alamofire/Alamofire.git
    :tag: 3.0.0-beta.3
  EstimoteSDK:
    :git: https://github.com/Estimote/iOS-SDK
  SwiftyJSON:
    :git: https://github.com/SwiftyJSON/SwiftyJSON.git

CHECKOUT OPTIONS:
  Alamofire:
    :git: https://github.com/Alamofire/Alamofire.git
    :tag: 3.0.0-beta.3
  EstimoteSDK:
    :commit: f2c3912a88cc270a1ba633d804955a87c72cf5c6
    :git: https://github.com/Estimote/iOS-SDK
  SwiftyJSON:
    :commit: 83dc3138b14571200ea7f070933a2a510491e997
    :git: https://github.com/SwiftyJSON/SwiftyJSON.git

SPEC CHECKSUMS:
  Alamofire: c89149e58431f6f94527e8c01f920456afe39bd0
  EstimoteSDK: 15d4cf50a4a1e41dcbb0c3cefd43207bed990d53
  SwiftyJSON: cacfe0373d584585716bd1d43202c24cc66afd65

COCOAPODS: 0.39.0
aforty commented 8 years ago

I found this link (http://stackoverflow.com/questions/31233395/ios-library-to-bitcode/31346742#31346742), suggesting I add the -fembed-bitcode flag to generate bitcode but it is already included.

Ld /Users/aforty/Library/Developer/Xcode/DerivedData/BeaconTest-dyoirklamyuupzfpxurhasvvhrly/Build/Intermediates/ArchiveIntermediates/BeaconTest/IntermediateBuildFilesPath/BeaconTest.build/Release-iphoneos/BeaconTest.build/Objects-normal/arm64/BeaconTest normal arm64
    cd /Users/aforty/Code/BeaconTest
    export IPHONEOS_DEPLOYMENT_TARGET=9.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk -L/Users/aforty/Library/Developer/Xcode/DerivedData/BeaconTest-dyoirklamyuupzfpxurhasvvhrly/Build/Intermediates/ArchiveIntermediates/BeaconTest/BuildProductsPath/Release-iphoneos -L/Users/aforty/Code/BeaconTest/Pods/EstimoteSDK -F/Users/aforty/Library/Developer/Xcode/DerivedData/BeaconTest-dyoirklamyuupzfpxurhasvvhrly/Build/Intermediates/ArchiveIntermediates/BeaconTest/BuildProductsPath/Release-iphoneos -F/Users/aforty/Code/BeaconTest/Pods/EstimoteSDK/EstimoteSDK -filelist /Users/aforty/Library/Developer/Xcode/DerivedData/BeaconTest-dyoirklamyuupzfpxurhasvvhrly/Build/Intermediates/ArchiveIntermediates/BeaconTest/IntermediateBuildFilesPath/BeaconTest.build/Release-iphoneos/BeaconTest.build/Objects-normal/arm64/BeaconTest.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=9.0 -dead_strip -fembed-bitcode -Xlinker -bitcode_verify -Xlinker -bitcode_hide_symbols -Xlinker -bitcode_symbol_map -Xlinker /Users/aforty/Library/Developer/Xcode/DerivedData/BeaconTest-dyoirklamyuupzfpxurhasvvhrly/Build/Intermediates/ArchiveIntermediates/BeaconTest/BuildProductsPath/Release-iphoneos -ObjC -framework Alamofire -framework CoreBluetooth -framework CoreLocation -framework EstimoteSDK -framework Foundation -framework MobileCoreServices -framework SwiftyJSON -framework SystemConfiguration -framework UIKit -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/aforty/Library/Developer/Xcode/DerivedData/BeaconTest-dyoirklamyuupzfpxurhasvvhrly/Build/Intermediates/ArchiveIntermediates/BeaconTest/IntermediateBuildFilesPath/BeaconTest.build/Release-iphoneos/BeaconTest.build/Objects-normal/arm64/BeaconTest.swiftmodule -framework Pods_BeaconTest -Xlinker -dependency_info -Xlinker /Users/aforty/Library/Developer/Xcode/DerivedData/BeaconTest-dyoirklamyuupzfpxurhasvvhrly/Build/Intermediates/ArchiveIntermediates/BeaconTest/IntermediateBuildFilesPath/BeaconTest.build/Release-iphoneos/BeaconTest.build/Objects-normal/arm64/BeaconTest_dependency_info.dat -o /Users/aforty/Library/Developer/Xcode/DerivedData/BeaconTest-dyoirklamyuupzfpxurhasvvhrly/Build/Intermediates/ArchiveIntermediates/BeaconTest/IntermediateBuildFilesPath/BeaconTest.build/Release-iphoneos/BeaconTest.build/Objects-normal/arm64/BeaconTest

ld: bitcode bundle could not be generated because '/Users/aforty/Code/BeaconTest/Pods/EstimoteSDK/EstimoteSDK/EstimoteSDK.framework/EstimoteSDK(ESTBeaconUpdateConfig.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
heypiotr commented 8 years ago

Can you check the MD5 sum of your EstimoteSDK binary file? Dunno, maybe there's some rogue caching going on? :dizzy_face:

$ md5 EstimoteSDK/EstimoteSDK.framework/EstimoteSDK 
MD5 (EstimoteSDK/EstimoteSDK.framework/EstimoteSDK) = 3ef42949c41dd1fbafcd3a3ff3784d18

(This is 3.7.1)

aforty commented 8 years ago

Sum checks out... :/

─> md5 Pods/EstimoteSDK/EstimoteSDK/EstimoteSDK.framework/EstimoteSDK
MD5 (Pods/EstimoteSDK/EstimoteSDK/EstimoteSDK.framework/EstimoteSDK) = 3ef42949c41dd1fbafcd3a3ff3784d18
heypiotr commented 8 years ago

Hmm, and if you start a completely new project from scratch?

aforty commented 8 years ago

Same issue on a new project from scratch.

Here is the project: https://www.dropbox.com/s/bsff9gvq0gpkb7z/test-estimote-xcode-proj.zip?dl=0

heypiotr commented 8 years ago

Still having hard time trying to reproduce ):

screen shot 2015-11-10 at 10 29 54

I downloaded the project, run pod install (got the latest Estimote SDK, 3.8.0), and it built just fine.

Xcode version maybe? I'm on 7.1 (7B91b)

aforty commented 8 years ago

And you're trying to build for production, aka "Archive" right? Test builds for the simulator and devices work fine for me, it's when I try to build my app for Test Flight or App Store distribution that it fails.

heypiotr commented 8 years ago

Aha! Sorry, I missed this one. I can reproduce now, which should speed up getting a fix ready. Thanks for your help trying to get to the bottom of this!

aforty commented 8 years ago

Fantastic, thank you! The sooner the better, I have to deploy this app I'm working on soon. Let me know if there's anything else I can help with.

yeagatron commented 8 years ago

Any word on this problem yet?

heypiotr commented 8 years ago

Yes! Turns out that we did indeed lack the "full bitcode" and were only generating the "bitcode markers," because we were using build and not the archive or install action in our build scripts. We already fixed the scripts, so it should go out with the next release.

If you're pressed on time, would you consider temporarily disabling bitcode in your iOS app target?

aforty commented 8 years ago

Excellent, thank you!

When are you expecting to release?

Unfortunately I am pressed for time. I believe disabling bit code is not an option when an app is compiled with a Apple Watch app/extension. I remember trying that and it gave me other errors that seemed more native to what Apple does.

tomazy commented 8 years ago

When can we expect the fix?

aforty commented 8 years ago

Any update on this? I can't push to the app store until this is released. I've held off for longer than I can already. The client is not happy...

martinklimek commented 8 years ago

We will release new version tomoroow. I will let you know immediately - sorry for delay!

MathisDetourbet commented 8 years ago

Hi ! Same issue for me.. Need a release asap ! Thx

martinklimek commented 8 years ago

SDK 3.8.1 contains fix for bitcode + eddystone stability improvements. If you have any issues let me know.

MathisDetourbet commented 8 years ago

Issue resolved in my case. Thx @martinklimek ! :-)

martinklimek commented 8 years ago

Great! Once again sorry for delay!