mattermost / react-native-network-client

React Native network client by Mattermost
Apache License 2.0
35 stars 16 forks source link

build issues #72

Open gregnb opened 3 years ago

gregnb commented 3 years ago

Hey everyone, wanted to say I stumbled upon your repo by pure luck. I really need a library that I can do raw network requests since fetch() won’t work the way I need it to. I noticed you had taken down your npm so I forked the repo and published it myself. I rather not but I really want to try this library out.

Right now when I try to consume the published package I get the following error:

The following build commands failed: CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler CompileSwift normal x86_64 /Users/greg/Documents/code/testo/tax-react-native-starterkit/node_modules/react-native-network-client/ios/WebSocketManager.swift (2 failures)

not much description as to what is really wrong?

enahum commented 3 years ago

Hi @gregnb appreciate the time you took to try this out.. the fact is that we haven't publish it as it's not ready yet.

I must respectfully ask you to bring down the library from npm if you named it react-native-network-client and made it public, if you named it differently feel free to keep it :)

Right... that said, your error.. @migbot can you provide some directions here?

gregnbey commented 3 years ago

@enahum totally understand. It’s renamed (I hid some company specifics) and in fact it’s only published to my private enterprise org so it’s NOT public at all

enahum commented 3 years ago

@gregnb thank you for that!

As for the error, @migbot should be around in a few hours, he is probably the best fit to help you out here

gregnbey commented 3 years ago

Some more error detail i missed:

some more detail i missed:

act-native-starterkit/ios/Pods/Headers/Public/React-Core -Xcc -I/Users//Documents/code/testo/tax-react-native-starterkit/ios/Pods/Headers/Public/React-callinvoker -Xcc -I/Users//Documents/code/testo/tax-react-native-starterkit/ios/Pods/Headers/Public/React-cxxreact -Xcc -I/Users//Documents/code/testo/tax-react-native-starterkit/ios/Pods/Headers/Public/React-jsi -Xcc -I/Users//Documents/code/testo/tax-react-native-starterkit/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -I/Users//Documents/code/testo/tax-react-native-starterkit/ios/Pods/Headers/Public/React-jsinspector -Xcc -I/Users//Documents/code/testo/tax-react-native-starterkit/ios/Pods/Headers/Public/React-perflogger -Xcc -I/Users//Documents/code/testo/tax-react-native-starterkit/ios/Pods/Headers/Public/React-runtimeexecutor -Xcc -I/Users//Documents/code/testo/tax-react-native-starterkit/ios/Pods/Headers/Public/Yoga -Xcc -I/Users//Documents/code/testo/tax-react-native-starterkit/ios/Pods/Headers/Public/glog -Xcc -I/Users//Library/Developer/Xcode/DerivedData/Taxreactnativestarterkit-gjnrxegcfaiahhhemubyqtpzgfop/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-network-client.build/DerivedSources-normal/x86_64 -Xcc -I/Users//Library/Developer/Xcode/DerivedData/Taxreactnativestarterkit-gjnrxegcfaiahhhemubyqtpzgfop/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-network-client.build/DerivedSources/x86_64 -Xcc -I/Users//Library/Developer/Xcode/DerivedData/Taxreactnativestarterkit-gjnrxegcfaiahhhemubyqtpzgfop/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-network-client.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG\=1 -Xcc -DDEBUG\=1 -Xcc -DCOCOAPODS\=1 -target-sdk-version 14.4 -module-name react_native_network_client -o /Users//Library/Developer/Xcode/DerivedData/Taxreactnativestarterkit-gjnrxegcfaiahhhemubyqtpzgfop/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-network-client.build/Objects-normal/x86_64/WebSocketManager.o -index-store-path /Users//Library/Developer/Xcode/DerivedData/Taxreactnativestarterkit-gjnrxegcfaiahhhemubyqtpzgfop/Index/DataStore -index-system-modules /Users//Documents/code/testo/tax-react-native-starterkit/node_modules/@react-native-network-client/ios/WebSocketManager.swift:72:95: error: extra argument 'clientCredential' in call let webSocket = WebSocket(request: request, certPinner: certPinner, clientCredential: clientCredential, compressionHandler: compressionHandler) ^~~~

migbot commented 3 years ago

Hi @gregnb. Oops, forgot to mention in the README that your app will need our fork of Starscream. See the example app's Podfile. Add the same line to your app's Podfile and you should be good to go. Hope this library is useful to you!

Edit: updated README in https://github.com/mattermost/react-native-network-client/commit/80a75a0e736b18a8e1eaee658bd857fc0e2087e5

gregnbey commented 3 years ago

@migbot thanks for the info Miguel! it got me one step further now I am facing this:

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 libStarscream.a(NativeEngine.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: Starscream.NativeEngine.write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: () -> ()?) -> () in libStarscream.a(NativeEngine.o) closure #1 (Swift.Result<(extension in Foundation):C.NSURLSessionWebSocketTask.Message, Swift.Error>) -> () in Starscream.NativeEngine.(doRead in _2D2A33380337B5EBE48BD9833E669011)() -> () in libStarscream.a(NativeEngine.o) "(extension in Foundation):C.NSURLSessionWebSocketTask.receive(completionHandler: (Swift.Result<(extension in Foundation):C.NSURLSessionWebSocketTask.Message, Swift.Error>) -> ()) -> ()", referenced from: Starscream.NativeEngine.(doRead in _2D2A33380337B5EBE48BD9833E669011)() -> () in libStarscream.a(NativeEngine.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: Starscream.NativeEngine.write(string: Swift.String, completion: () -> ()?) -> () in libStarscream.a(NativeEngine.o) closure #1 (Swift.Result<(extension in Foundation):C.NSURLSessionWebSocketTask.Message, Swift.Error>) -> () in Starscream.NativeEngine.(doRead in _2D2A33380337B5EBE48BD9833E669011)() -> () in libStarscream.a(NativeEngine.o) "type metadata accessor for (extension in Foundation):C.NSURLSessionWebSocketTask.Message", referenced from: Starscream.NativeEngine.write(string: Swift.String, completion: () -> ()?) -> () in libStarscream.a(NativeEngine.o) Starscream.NativeEngine.write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: () -> ()?) -> () in libStarscream.a(NativeEngine.o) closure #1 (Swift.Result<(extension in Foundation):C.NSURLSessionWebSocketTask.Message, Swift.Error>) -> () in Starscream.NativeEngine.(doRead in 2D2A33380337B5EBE48BD9833E669011)() -> () in libStarscream.a(NativeEngine.o) outlined init with copy of Swift.Result<(extension in Foundation):C.NSURLSessionWebSocketTask.Message, Swift.Error> in libStarscream.a(NativeEngine.o) "(extension in Foundation):C.NSURLSessionWebSocketTask.send(: (extension in Foundation):C.NSURLSessionWebSocketTask.Message, completionHandler: (Swift.Error?) -> ()) -> ()", referenced from: Starscream.NativeEngine.write(string: Swift.String, completion: () -> ()?) -> () in libStarscream.a(NativeEngine.o) Starscream.NativeEngine.write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: () -> ()?) -> () in libStarscream.a(NativeEngine.o)

ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Already did pod wipe & install. no improvement

migbot commented 3 years ago

@gregnbey Hmm, I'm not sure why this is not building. It looks like something is missing for running on a simulator so I tried running on a physical device, however, I get a similar error of Undefined symbols for architecture arm64:. I think something must be going wrong when building the lib into a package... Unfortunately I don't have the bandwidth to look into any further until next week :/

gregnbey commented 3 years ago

@migbot no biggie man! appreciate even you responding tbh.

my end goal with this lib is to see if i can leverage it to complete a login flow in RN that allows me to extract the cookies which contain the token to leverage within the RN app itself. i see no path because of redirection/security issues with different attempts (ie: rn native, XMLHTTP etc)

migbot commented 3 years ago

@gregnb np. Regarding cookies, are you not able to use react-native-cookies?

gregnb commented 3 years ago

@migbot cookies always come up empty. it’s an issue of redirects and http only headers.

migbot commented 3 years ago

Hey @gregnb, the master branch should be ready for use. I've added a troubleshooting section to the README with a comment about the undefined symbols issue.