tuanpmt/react-native-mqtt

Error building for iOS with Xcode 7.3

Opened this issue · 6 comments

I've followed your instructions after creating a new blank React Native application. I keep getting the following error when trying to build the application.

RCTMqtt.m:15:9: 'MQTTClient/MQTTClient.h' file not found

I was able to get it to build by doing the following:

  • Click "RCTMqtt.xcodeproj" in your XCode project directory -> Build Settings -> Search for "Header Search Path" and add "$(SRCROOT)/../../../react-native-mqtt/ios/RCTMqtt - recursive"
  • Under your project Build Phases -> Link Binary with Libraries -> Add "libicucore.tdb"

I was also getting CocoaLumberjack/CocoaLumberjack.h not found errors so I directly modified "Mqtt.h" and "RCTMqtt.m" to put in the proper directory path "#import <CocoaLumberjack/Classes/CocoaLumberjack.h>" <- Added "Classes" (just search through the Pods directory and you'll see "CocoaLumberjack.h" exists but is under Classes.

Hopefully @tuanpmt can chime in on the last item as I don't really want to modify the files themselves. Short of doing that I was going to install CocoaLumberjack via Pods to see if it was included.

@sloanwolf good job,It's very helpful for me!

@sloanwolf Thanks so much!

good job!Thanks @sloanwolf

good job!Thank you @sloanwolf

Also for "React Native Redefinition of 'RCTMethodInfo' in RCTBridgeModule.h" error
changed #import "RCTBridgeModule" to #import <React/RCTBridgeModule.h>