3

I tried to import iOS SDK in Objective C for Hue.

I followed instructions here : https://github.com/PhilipsHue/PhilipsHueSDK-iOS-OSX

I added the HueSDK_iOS.framework to my project, I added all Lumberjack files and I created the .h with the import line.

After, I used in my code :

var phHueSdk : PHHueSDK = PHHueSDK()
var searching : PHBridgeSearching = PHBridgeSearching()

I have this errors :

Undefined symbols for architecture armv7k: "_OBJC_CLASS_$_PHHueSDK", referenced from: type metadata accessor for __ObjC.PHHueSDK in InterfaceController.o "_OBJC_CLASS_$_PHBridgeSearching", referenced from: type metadata accessor for __ObjC.PHBridgeSearching in InterfaceController.o ld: symbol(s) not found for architecture armv7k clang: error: linker command failed with exit code 1 (use -v to see invocation)

I found many solutions for this problem like add files to the compile sources for example. It doesn't work.

UPDATE :

This problem is solve when you add your SDK to Link Binary in Build Phases of your project WatchKit Extension

New problem :

ld: file is universal (4 slices) but does not contain a(n) armv7k slice: ... clang: error: linker command failed with exit code 1 (use -v to see invocation)

I work on watchOS. Maybe the SDK doesn't support watchOS

  • My HueSDK_iOS.framework was just into the Link Binary of my Project. So, I added a link in the Link Binary (Build Phases) of my project Watch Extension too. – Pierre Charpentier Jul 25 '16 at 07:19
  • Now, I have this problem with architecture : ld: file is universal (4 slices) but does not contain a(n) armv7k slice: ... clang: error: linker command failed with exit code 1 (use -v to see invocation) – Pierre Charpentier Jul 25 '16 at 07:20

1 Answers1

0

Right, it's named HueSDK_iOS.framework for a reason: iOS and watchOS are two different operating systems, with two different architectures.

Instead, either have your watch app talk to your phone app (recommended), or ditch the SDK completely and have your watch app send http/json to read and write the bridge JSON directly, using NSURLSession and NSJSONSerialization.

Ron Reuter
  • 1,287
  • 1
  • 8
  • 14