0

I am trying to include the Estimote SDK 3.0 into my project, but i am getting the following linking error:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_ESTBeaconRegionWrapper", referenced from:
      objc-class-ref in EstimoteSDK(ESTSecureBeaconManager.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have added the framework to the 'Build phase' and checked that the framework search directory setting contains the directory.

I downloaded the example App from Estimote, and it used the same framework (that is where I copied it from) and that build fine. I can't see any obvious differences.

How can I figure out what is wrong?

EDIT: I am using Xcode 6.2. I am building for an iPhone 6 (said architectures arm64, armv7, armv7s). After the question below I build for armv7s, and I get the same error (for armv7s). So there must be a problem linking the Framework.

EDIT 2: I removed the -ObjC 'Other linker flag', as adding that to the Estimote project generates the same error. However now I get a lot more errors:

Ld /Users/.../iDomsPortalDev normal arm64
    cd "/Users/.../idoms-portal"
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/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/iPhoneOS8.2.sdk -L/Users/.../Products/Debug-iphoneos -F/Users/.../Products/Debug-iphoneos -FiDoms/frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/.../Debug-iphoneos/iDoms\ Dev.build/Objects-normal/arm64/iDomsPortalDev.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -lxml2 -lc++ -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -framework CrashReporter -framework EstimoteSDK -weak_framework Accelerate -weak_framework Social -weak_framework Twitter -framework MessageUI -framework MapKit -framework AVFoundation -framework SystemConfiguration -framework MediaPlayer -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -framework CoreLocation -Xlinker -dependency_info -Xlinker /Users/.../Debug-iphoneos/iDoms\ Dev.build/Objects-normal/arm64/iDomsPortalDev_dependency_info.dat -o /Users/.../iDomsPortalDev

Undefined symbols for architecture arm64:
  "_CBAdvertisementDataServiceDataKey", referenced from:
      +[ESTDeviceDataHelper parseAdvertisingData:] in EstimoteSDK(ESTDeviceDataHelper.o)
  "_OBJC_CLASS_$_CBCentralManager", referenced from:
      objc-class-ref in EstimoteSDK(ESTBeaconDevice.o)
  "_kSecAttrService", referenced from:
      -[ESTKeychain dataForKey:] in EstimoteSDK(ESTKeychain.o)
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
      +[ESTKeychain bundleSeedID] in EstimoteSDK(ESTKeychain.o)
  "_kSecAttrAccessibleAfterFirstUnlock", referenced from:
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
  "_OBJC_CLASS_$_CBUUID", referenced from:
      objc-class-ref in EstimoteSDK(ESTBeaconDevice.o)
      objc-class-ref in EstimoteSDK(ESTBluetoothServiceAuth.o)
      objc-class-ref in EstimoteSDK(ESTBluetoothServiceEstimote.o)
      objc-class-ref in EstimoteSDK(ESTBluetoothServiceOta.o)
      objc-class-ref in EstimoteSDK(ESTBluetoothServiceSoftware.o)
      objc-class-ref in EstimoteSDK(ETBluetoothMath.o)
  "_kSecAttrAccessibleWhenUnlocked", referenced from:
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
  "_kSecReturnAttributes", referenced from:
      +[ESTKeychain bundleSeedID] in EstimoteSDK(ESTKeychain.o)
  "_kSecAttrAccessible", referenced from:
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
  "_kSecAttrAccessibleAlways", referenced from:
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
  "_CBCentralManagerScanOptionAllowDuplicatesKey", referenced from:
      -[ESTBeaconDevice startScanning] in EstimoteSDK(ESTBeaconDevice.o)
  "_SecItemDelete", referenced from:
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
  "_kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly", referenced from:
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
  "_kSecAttrAccessibleAlwaysThisDeviceOnly", referenced from:
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
  "_SecItemUpdate", referenced from:
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
  "_kSecAttrAccessibleWhenUnlockedThisDeviceOnly", referenced from:
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
  "_SecItemAdd", referenced from:
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
      +[ESTKeychain bundleSeedID] in EstimoteSDK(ESTKeychain.o)
  "_SecItemCopyMatching", referenced from:
      -[ESTKeychain dataForKey:] in EstimoteSDK(ESTKeychain.o)
      +[ESTKeychain bundleSeedID] in EstimoteSDK(ESTKeychain.o)
  "_kSecClass", referenced from:
      -[ESTKeychain dataForKey:] in EstimoteSDK(ESTKeychain.o)
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
      +[ESTKeychain bundleSeedID] in EstimoteSDK(ESTKeychain.o)
  "_kSecClassGenericPassword", referenced from:
      -[ESTKeychain dataForKey:] in EstimoteSDK(ESTKeychain.o)
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
      +[ESTKeychain bundleSeedID] in EstimoteSDK(ESTKeychain.o)
  "_kSecAttrAccount", referenced from:
      -[ESTKeychain dataForKey:] in EstimoteSDK(ESTKeychain.o)
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
      +[ESTKeychain bundleSeedID] in EstimoteSDK(ESTKeychain.o)
  "_kSecValueData", referenced from:
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
  "_kSecAttrAccessGroup", referenced from:
      -[ESTKeychain dataForKey:] in EstimoteSDK(ESTKeychain.o)
      -[ESTKeychain setObject:forKey:] in EstimoteSDK(ESTKeychain.o)
      +[ESTKeychain bundleSeedID] in EstimoteSDK(ESTKeychain.o)
  "_kSecMatchLimitOne", referenced from:
      -[ESTKeychain dataForKey:] in EstimoteSDK(ESTKeychain.o)
  "_kSecMatchLimit", referenced from:
      -[ESTKeychain dataForKey:] in EstimoteSDK(ESTKeychain.o)
  "_kSecReturnData", referenced from:
      -[ESTKeychain dataForKey:] in EstimoteSDK(ESTKeychain.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

[Edit 3:] With the Security.framework added it seems to make another step:

Ld /Users/.../Products/Debug-iphoneos/iDomsPortalDev.app/iDomsPortalDev normal arm64
    cd "/Users/.../idoms-portal"
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/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/iPhoneOS8.2.sdk -L/Users/.../Products/Debug-iphoneos -F/Users/.../Library/Frameworks -filelist /Users/.../iDoms.build/Debug-iphoneos/iDoms\ Dev.build/Objects-normal/arm64/iDomsPortalDev.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -lxml2 -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -framework Security -framework CrashReporter -framework EstimoteSDK -weak_framework Accelerate -weak_framework Social -weak_framework Twitter -framework MessageUI -framework MapKit -framework AVFoundation -framework SystemConfiguration -framework MediaPlayer -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -framework CoreLocation -Xlinker -dependency_info -Xlinker /Users/Luuk/Library/Developer/Xcode/DerivedData/iDoms-gperwbbtttggqpcvozenraexrhrx/Build/Intermediates/iDoms.build/Debug-iphoneos/iDoms\ Dev.build/Objects-normal/arm64/iDomsPortalDev_dependency_info.dat -o /Users/Luuk/Library/Developer/Xcode/DerivedData/iDoms-gperwbbtttggqpcvozenraexrhrx/Build/Products/Debug-iphoneos/iDomsPortalDev.app/iDomsPortalDev

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_CBCentralManager", referenced from:
      objc-class-ref in EstimoteSDK(ESTBeaconDevice.o)
  "_OBJC_CLASS_$_CBUUID", referenced from:
      objc-class-ref in EstimoteSDK(ESTBeaconDevice.o)
      objc-class-ref in EstimoteSDK(ESTBluetoothServiceAuth.o)
      objc-class-ref in EstimoteSDK(ESTBluetoothServiceEstimote.o)
      objc-class-ref in EstimoteSDK(ESTBluetoothServiceOta.o)
      objc-class-ref in EstimoteSDK(ESTBluetoothServiceSoftware.o)
      objc-class-ref in EstimoteSDK(ETBluetoothMath.o)
  "_CBAdvertisementDataServiceDataKey", referenced from:
      +[ESTDeviceDataHelper parseAdvertisingData:] in EstimoteSDK(ESTDeviceDataHelper.o)
  "_CBCentralManagerScanOptionAllowDuplicatesKey", referenced from:
      -[ESTBeaconDevice startScanning] in EstimoteSDK(ESTBeaconDevice.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Luuk D. Jansen
  • 4,402
  • 8
  • 47
  • 90
  • Have you checked whether there is new version for the library you use? And can you give some information about your app architecture & valid architecture in build settings and the version of the XCode you use? (It seems that the library does not support Arm64.) – ondermerol Mar 20 '15 at 09:57
  • I added the Xcode version. It doesn't build for armv7s either, so there must be a problem in the linking. Probably something small/simple I have to do or have forgotten. – Luuk D. Jansen Mar 20 '15 at 11:11
  • The Estimote Example project has no linker flags set. – Luuk D. Jansen Mar 20 '15 at 11:46
  • Hey, Piotr from Estimote here—we actually consider this a bug and are working on a resolution, stay tuned for a bug-fix release. – heypiotr Mar 26 '15 at 09:20
  • Hi @heypiotr, please see my solution at the bottom, I think that solved it for me, don't need the Security. Just old build settings on an existing project. – Luuk D. Jansen Mar 26 '15 at 09:32
  • 1
    Nice! We had a few more people reporting that changing these settings helps. We've just pushed 3.0.2 live though, which should fix this issue without having to change anything (: – heypiotr Mar 26 '15 at 16:56

4 Answers4

1

Thanks to the various hints above I went through the whole build file, and found the flag that was different. It is 'Enable Modules', and was set to 'No' in my build settings.

Luuk D. Jansen
  • 4,402
  • 8
  • 47
  • 90
0

I just downloaded https://github.com/Estimote/iOS-SDK their SDK and successfully included it in a sample project.

Under 'Build Settings' in 'Build Active Architecture Only' set 'Debug' to YES

Also Try In 'General' tabs

  • Add framework under 'Link Frameworks and Libraries'.
  • Add framework under 'Embedded Binaries'.

Make sure that EstimoteSDK.framework is actually present at its original location, you may have accidentally deleted it.

swapnilagarwal
  • 1,126
  • 8
  • 16
  • Some of the OPs errors are missing `Security.framework` dependency. How did you manage to integrate it without needing it? Did you actually use any of the framework's functionality? – trojanfoe Mar 20 '15 at 11:53
  • I am only started to integrate it, but am using some of the classes already. The Security.framework is not present in the example App either. – Luuk D. Jansen Mar 20 '15 at 12:02
  • I must be something in my build settings so. Just don't know where to start, this project is 3 years old, so there might be changes in there inherited from much earlier iOS versions. – Luuk D. Jansen Mar 20 '15 at 12:02
  • Interesting, when I add the Security.framework I get different (or less?) errors, see above edit3. Any other suggestions? – Luuk D. Jansen Mar 20 '15 at 12:28
0

Looking at the podspec it specifies -lc++ flag to be added to OTHER_LDFLAGS. If you don't have this flag set, maybe that could cause such problems.

MANIAK_dobrii
  • 6,014
  • 3
  • 28
  • 55
  • I think I see what the problem is. I have -ObjC set. If I set that on the Estimote project it fails too, so it must be in that corner somewhere. I can't remember why I needed to add -ObjC. If I remove it from my exiting project I get a whole lot more errors of Estimote. I will post the full error list above. – Luuk D. Jansen Mar 20 '15 at 11:38
0

This is fixed in Estimote SDK 3.0.2! (:

https://github.com/Estimote/iOS-SDK/blob/master/CHANGELOG.md#302-march-26-2015

heypiotr
  • 2,139
  • 2
  • 15
  • 22