davesters / rn-native-mqtt

An MQTT client for React Native that actually works and exposes a simple Javascript interface
MIT License
64 stars 44 forks source link

Symbol(s) not found for architecture x86_64 #10

Closed kvaghas closed 4 years ago

kvaghas commented 4 years ago

After following steps for adding bridge file and updating minimum deployment to 10.0 for iOS. White trying to run project I am getting following error:

React-native: "0.62.2"

Undefined symbols for architecture x86_64:
  "nominal type descriptor for (extension in Foundation):__C.NSURLSessionWebSocketTask.Message", referenced from:
      _symbolic _____y___________pG s6ResultO So25NSURLSessionWebSocketTaskC10FoundationE7MessageO s5ErrorP in libreact-native-native-mqtt.a(CocoaMQTTWebSocket.o)
      _symbolic _____y___________pGz_Xx s6ResultO So25NSURLSessionWebSocketTaskC10FoundationE7MessageO s5ErrorP in libreact-native-native-mqtt.a(CocoaMQTTWebSocket.o)
  "enum case for (extension in Foundation):__C.NSURLSessionWebSocketTask.Message.data((extension in Foundation):__C.NSURLSessionWebSocketTask.Message.Type) -> (Foundation.Data) -> (extension in Foundation):__C.NSURLSessionWebSocketTask.Message", referenced from:
      react_native_native_mqtt.CocoaMQTTWebSocket.FoundationConnection.write(data: Foundation.Data, handler: (Swift.Error?) -> ()) -> () in libreact-native-native-mqtt.a(CocoaMQTTWebSocket.o)
      closure #1 () -> () in closure #1 (Swift.Result<(extension in Foundation):__C.NSURLSessionWebSocketTask.Message, Swift.Error>) -> () in closure #1 () -> () in react_native_native_mqtt.CocoaMQTTWebSocket.FoundationConnection.scheduleRead() -> () in libreact-native-native-mqtt.a(CocoaMQTTWebSocket.o)
  "enum case for (extension in Foundation):__C.NSURLSessionWebSocketTask.Message.string((extension in Foundation):__C.NSURLSessionWebSocketTask.Message.Type) -> (Swift.String) -> (extension in Foundation):__C.NSURLSessionWebSocketTask.Message", referenced from:
      closure #1 () -> () in closure #1 (Swift.Result<(extension in Foundation):__C.NSURLSessionWebSocketTask.Message, Swift.Error>) -> () in closure #1 () -> () in react_native_native_mqtt.CocoaMQTTWebSocket.FoundationConnection.scheduleRead() -> () in libreact-native-native-mqtt.a(CocoaMQTTWebSocket.o)
  "(extension in Foundation):__C.NSURLSessionWebSocketTask.receive(completionHandler: (Swift.Result<(extension in Foundation):__C.NSURLSessionWebSocketTask.Message, Swift.Error>) -> ()) -> ()", referenced from:
      closure #1 () -> () in react_native_native_mqtt.CocoaMQTTWebSocket.FoundationConnection.scheduleRead() -> () in libreact-native-native-mqtt.a(CocoaMQTTWebSocket.o)
  "type metadata accessor for (extension in Foundation):__C.NSURLSessionWebSocketTask.Message", referenced from:
      react_native_native_mqtt.CocoaMQTTWebSocket.FoundationConnection.write(data: Foundation.Data, handler: (Swift.Error?) -> ()) -> () in libreact-native-native-mqtt.a(CocoaMQTTWebSocket.o)
      closure #1 () -> () in closure #1 (Swift.Result<(extension in Foundation):__C.NSURLSessionWebSocketTask.Message, Swift.Error>) -> () in closure #1 () -> () in react_native_native_mqtt.CocoaMQTTWebSocket.FoundationConnection.scheduleRead() -> () in libreact-native-native-mqtt.a(CocoaMQTTWebSocket.o)
      outlined init with copy of Swift.Result<(extension in Foundation):__C.NSURLSessionWebSocketTask.Message, Swift.Error> in libreact-native-native-mqtt.a(CocoaMQTTWebSocket.o)
  "(extension in Foundation):__C.NSURLSessionWebSocketTask.send(_: (extension in Foundation):__C.NSURLSessionWebSocketTask.Message, completionHandler: (Swift.Error?) -> ()) -> ()", referenced from:
      react_native_native_mqtt.CocoaMQTTWebSocket.FoundationConnection.write(data: Foundation.Data, handler: (Swift.Error?) -> ()) -> () in libreact-native-native-mqtt.a(CocoaMQTTWebSocket.o)
ld: symbol(s) not found for architecture x86_64
KrunalXpress commented 4 years ago

I tried with deployment target 9.0 and updating podspec of library, pods gets installed but getting this error - https://github.com/davesters/rn-native-mqtt/issues/11

aposnov commented 3 years ago

and how it can be resolved?

konradcho commented 3 years ago

In Project(NOT TARGET) Build Settings -> Library Search Paths - remove "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"

Then in Pod Settings for react-native-native-mqtt -> Build Phases -> Compile Sources - remove 2 files: - GDCAsyncSocket.m - GDCAsyncUdpSocket.m