1

I'm trying to build a simple application with Swift that can turn on and off my Philips Hue Lights, but after following the official SDK steps, I'm getting some weird errors. The errors I'm getting are:

these are the errors that I'm getting

Does anyone that has any experience with the HUE SDK know what's wrong? This is after adding -ObjC in my linker flags

And I'm following the steps detailed here http://www.developers.meethue.com/documentation/apple-sdk

Nik
  • 1,664
  • 2
  • 14
  • 27
Jolaroux
  • 361
  • 1
  • 5
  • 15
  • Did you add *-ObjC* to target or project? – Nik Sep 24 '16 at 01:08
  • To target! Should it have been project? – Jolaroux Sep 24 '16 at 01:16
  • No, target is correct. You can try adding to both though anyway – Nik Sep 24 '16 at 01:16
  • after adding it to project, still getting the same errors, do you have any idea whats wrong? – Jolaroux Sep 24 '16 at 01:17
  • That's what I thought would happen. Have you tried running this on an actual device? Or just on simulator? – Nik Sep 24 '16 at 01:18
  • After trying on my iPhone, same errors still :( – Jolaroux Sep 24 '16 at 01:19
  • Did you have to add (custom) frameworks? If so, did you enable "Copy items if needed"? – Nik Sep 24 '16 at 01:21
  • Yes I had to add the framework file they provided along with another set of files, and yes I enabled the copy items checkbox for both – Jolaroux Sep 24 '16 at 01:24
  • Are there other necessary frameworks to add? Did you check the `Build Phases` of the target then `Link with binaries` (or something like that) to see if the frameworks appears there – Nik Sep 24 '16 at 01:26
  • Just looked and Yes it's there. Sorry I can't be of more help, I'm new to swift and objc so I really don't know how to fix these errors. And no there was just the one framework to add – Jolaroux Sep 24 '16 at 01:29
  • The tutorial didn't tell you to add any other frameworks, like Core Graphics? If no, try adding architecture `x86_64` to the target. By the way, it's no problem, everyone has to start somewhere – Nik Sep 24 '16 at 01:33
  • I think I added it correctly, http://imgur.com/JEAQPgA , and still getting the same errors. And hey thanks for all your help so far!! – Jolaroux Sep 24 '16 at 01:40
  • Another possibility is to clean the project. **Shift-CMD-K**. Also, if you added many files, try removing them one at a time (mark down the ones you remove so you remember for later) and see which one(s) are causing the problem(s). Additionally, it's entirely possible that this framework/file(s) is outdated – Nik Sep 24 '16 at 01:41
  • Try removing `arm64`. I've heard that arm64 doesn't work with x86_64. No problem, I hope I can help solve this issue – Nik Sep 24 '16 at 01:42
  • Cleaned it, and removed arm64 and still same errors :( And I was thinking the same thing until someone else on StackOverflow told me that they were using the same SDK with swift 3 – Jolaroux Sep 24 '16 at 01:48
  • If you remember who it was, you might be able to ask them how they did it... – Nik Sep 24 '16 at 01:50
  • Try this link: http://www.developers.meethue.com/content/lumberjack. It seems that the only other common problem is that you downloaded an older version of this. If try re-downloading the files/frameworks. If you're getting them off GitHub read the changelogs and important notices/info for links to newer versions or something of that sort. Also see this: https://github.com/PhilipsHue/PhilipsHueSDK-iOS-OSX/issues/43 – Nik Sep 24 '16 at 01:54
  • I sent the person a message, it was actually on GitHub that he mentioned it, and I posted an issue about it on the github page for the SDK. And I'll look into that! Let me try what its suggesting – Jolaroux Sep 24 '16 at 02:03
  • Alright. Let me know how it goes – Nik Sep 24 '16 at 02:06
  • Hue SDK isn't built for x86_64... If u have the framework as a subproject in the build settings set build active architecture to NO and try. If it didn't work, there are numerous questions of x86_64 undefined symbols, please search. – Sachin Vas Sep 24 '16 at 02:15
  • Holy crap It compiled!! What I did was take all the lumberjack files out of the folder and then put them in the project individually, but then it was giving me the error saying it couldn't find the name of the folder in the actual folder of the project (like in finder), so I copied the lumberjack folder into the finder folder of the project, and then it compiled! So its working, but in the folder of the project it has both the individual files from the Lumberjack folder, and the full lumberjack folder with the files in there too. I don't know how efficient that is, or if my – Jolaroux Sep 24 '16 at 02:30
  • app will work from here on out, But i know that its finally compiling :)) Thanks so much for your help Nik – Jolaroux Sep 24 '16 at 02:31
  • @Jolaroux No prob – Nik Sep 24 '16 at 02:46
  • Why not use HomeKit Framework ? – iDeveloper Sep 24 '16 at 04:44
  • Could you tell me more about that? I was thinking about that but I didn't know how – Jolaroux Sep 24 '16 at 21:23

0 Answers0