Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build issues #72

Open
gregnb opened this issue Apr 29, 2021 · 11 comments
Open

build issues #72

gregnb opened this issue Apr 29, 2021 · 11 comments

Comments

@gregnb
Copy link

gregnb commented Apr 29, 2021

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
Copy link
Contributor

enahum commented Apr 29, 2021

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
Copy link

gregnbey commented Apr 29, 2021

@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
Copy link
Contributor

enahum commented Apr 29, 2021

@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
Copy link

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
Copy link
Contributor

migbot commented Apr 29, 2021

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 80a75a0

@gregnbey
Copy link

gregnbey commented Apr 29, 2021

@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
Copy link
Contributor

migbot commented Apr 29, 2021

@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
Copy link

@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
Copy link
Contributor

migbot commented Apr 29, 2021

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

@gregnb
Copy link
Author

gregnb commented Apr 29, 2021

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

@migbot
Copy link
Contributor

migbot commented May 19, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants