tuanpmt/react-native-mqtt

'MQTTClient/MQTTClient.h' file not found

Closed this issue ยท 9 comments

j8 commented

Hi, when trying to build the library I always get:

screen shot 2016-03-19 at 11 30 05

j8 commented

I managed to resolve this by removing the Podfile.lock and running pod install again. But now has another issue:

Undefined symbols for architecture arm64:
  "_utf8_nextCharSafeBody", referenced from:
      _validate_dispatch_data_partial_string in libRCTMqtt.a(SRWebSocket.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
j8 commented

Linking libicucore.tbd seems to fix the issue. Maybe it's good to mention this in the README

I'm actually running into the same issue. But I am unable to resolve it like you did with removing the Podfile.lock followed by the pod install.

Are you saying that you link libicucore.tbd to < your project folder >?

j8 commented

@aestrro you need to link libicucore.tbd in your build phases

screen shot 2016-04-08 at 13 48 46

Well... that worked, and yes adding that to the README would be splendid ๐Ÿ‘

j8 commented

Nice that it worked for you, I'll open a pool request for enhancing the README. Also I have few major fixes, as the react native library is not passing correctly params to the the native mqtt lib

That's awesome, I'll definitely keep an eye out. Now that this has been resolved for me I am trying to call methods like this:

// accessing 'publish' outside of .then(function(client) {}) scope
client.subscribe( '#' ,0);
client.publish( '/dest/' , JSON.stringify({ 'name':'aestrro' }), 0, false );

Anyways, thanks for everything, I'm going to pick this back up on Monday. If you have any tips, please let me know..

Doing like you, but have this error after pod install

[!] Unable to find host target(s) for RCTMqtt. Please add the host targets for the embedded targets to the Podfile.
Certain kinds of targets require a host target. A host target is a "parent" target which embeds a "child" target. These are example types of targets that need a host target:
- Framework
- App Extension
- Watch OS 1 Extension
- Messages Extension (except when used with a Messages Application)

Maybe someone know how to fix it?

I have the same problem. Has anyone managed to fix this?