react-native-mqtt icon indicating copy to clipboard operation
react-native-mqtt copied to clipboard

Error building for iOS with Xcode 7.3

Open Morne-Digia opened this issue 9 years ago • 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

Morne-Digia avatar Apr 18 '16 10:04 Morne-Digia

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 avatar May 26 '16 05:05 sloanwolf

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

J1aDong avatar Oct 24 '16 06:10 J1aDong

@sloanwolf Thanks so much!

ngankt2 avatar Apr 12 '17 03:04 ngankt2

good job!Thanks @sloanwolf

HAPENLY avatar Nov 23 '17 06:11 HAPENLY

good job!Thank you @sloanwolf

tianguanghui avatar Jan 26 '18 09:01 tianguanghui

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

sw-tt-keyurprajapati avatar Dec 04 '19 10:12 sw-tt-keyurprajapati