1

Error:

Ld DerivedData/SenseWatch/Build/Products/Debug-iphonesimulator/SenseWatch.app/SenseWatch normal x86_64
cd /Users/Jieyi/Documents/Repo/SenseWatch
export IPHONEOS_DEPLOYMENT_TARGET=9.0
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -L/Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Products/Debug-iphonesimulator -F/Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Products/Debug-iphonesimulator -filelist /Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Intermediates/SenseWatch.build/Debug-iphonesimulator/SenseWatch.build/Objects-normal/x86_64/SenseWatch.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=9.0 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -framework MicrosoftBandKit_iOS -Xlinker -dependency_info -Xlinker /Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Intermediates/SenseWatch.build/Debug-iphonesimulator/SenseWatch.build/Objects-normal/x86_64/SenseWatch_dependency_info.dat -o /Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Products/Debug-iphonesimulator/SenseWatch.app/SenseWatch

ld: framework not found MicrosoftBandKit_iOS
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I just created the project, added the framework in build phases. the framework is clearly under the project. but it still says not found. i know that it may needs to finish framework search path. but i don't understand how to? like put in the absolute path for the framework?

Jay Hu
  • 6,041
  • 3
  • 22
  • 33
  • I notice you are targeting iOS 9. I am using Swift 2 and iOS 9.0.1 but for some reason I can not connect to the Band. It knows if there are no Bands available to connect but when I try to connect to a client it does nothing. Have you had success in connecting to the Band? – Ste Prescott Sep 24 '15 at 17:39
  • Did you install Microsoft Health App? And did you get client from attachedClients? – Jay Hu Sep 24 '15 at 17:41
  • Yes, (MSBClient) client = 0x0000000147e4d500 { NSObject = { isa = 0x0000000147e4d500 } _notificationManager = nil _personalizationManager = nil _tileManager = nil _sensorManager = nil _name = 0x0000000147e4df60 "Ste's Band 68:a2 LE" _connectionIdentifier = 0x0000000147e4d580 _tileDelegate = nil _clientManager = 0x0000000147e485f0 _deviceAgent = 0x0000000147e4dcc0 _dispatchQueue = 0x0000000147e4d020 _subscriptionSampleParser = nil } – Ste Prescott Sep 24 '15 at 17:55
  • Apologies for the bad formatting but it's not directly related to the question so I don't want to add an answer. – Ste Prescott Sep 24 '15 at 17:55
  • well, in this case, I have no good answer. I did have it connected and do other stuff after with Swift 2 and iOS 9 GM. However, you may wanna try unpair in MS Health App, reset MS Band, and pair them again to try if its something else other than your code. Sorry – Jay Hu Sep 24 '15 at 18:03
  • Thanks for your help, I figured it out. Although I was using import CoreBluetooth in my .swift file, it still required me to add it to the link with libraries section. – Ste Prescott Sep 24 '15 at 18:19
  • I remember I have this problem with missing CoreBluetooth long ago, however, in my on going project, everything works without the CoreBluetooth. That's why I didn't think of the solution. However, it is weird that it still works without CoreBluetooth – Jay Hu Sep 24 '15 at 18:21
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/90556/discussion-between-ste-prescott-and-fullstackpug). – Ste Prescott Sep 24 '15 at 18:23

2 Answers2

4

no absolute path is bad way, it only work in your computer, not work with your partner. Set relative path is best way. To set path for framework:

  1. be sure framework locate in project folder

  2. select target -> Build Setting -> Search Path-> Framework Search Paths. Double click it will show an Search Paths input text view

  3. in Finder go to folder content framework. Drag this folder to search paths input text view. it will be some thing like "$(SRCROOT)/Vendors/FacebookSDK"

  4. just remove double qoute "", result: $(SRCROOT)/Vendors/FacebookSDK

done!

enter image description here

larva
  • 4,687
  • 1
  • 24
  • 44
  • What if we have multiple files, It's hard to drag and drop that many files right... – Anish Kodeboyina Sep 01 '17 at 15:21
  • dragging the folder and see that xcode create this SRCROOT string..teach me very good lesson. thanks. for other I say it's important to drag the folder without tapping + button. – user1105951 Sep 20 '18 at 17:57
0

http://stationinthemetro.com/2014/06/04/copy-file-path-as-text-in-mac-os-x i use this and copy the absolute path and put it under framework search path and it works

Jay Hu
  • 6,041
  • 3
  • 22
  • 33