socket.io-client-swift-example
socket.io-client-swift-example copied to clipboard
Can't build client -- missing certain SocketIOClientSwift files
Hello, I'm trying to get socket.io-client-swift-example running. I'm on step "Setup First Client." I've opened the project in Xcode but when I try to build and run I'm hit with a host of errors, all related to missing files:
<unknown>:0: error: no such file or directory: '/Users/pzurek/dev/ios/sockets/socket.io-client-swift-example/TicTacIOiOS/SocketIOClientSwift/Source/SocketIOClient.swift'
<unknown>:0: error: no such file or directory: '/Users/pzurek/dev/ios/sockets/socket.io-client-swift-example/TicTacIOiOS/SocketIOClientSwift/Source/WebSocket.swift'
<unknown>:0: error: no such file or directory: '/Users/pzurek/dev/ios/sockets/socket.io-client-swift-example/TicTacIOiOS/SocketIOClientSwift/Source/SocketEngineWebsocket.swift'
<unknown>:0: error: no such file or directory: '/Users/pzurek/dev/ios/sockets/socket.io-client-swift-example/TicTacIOiOS/SocketIOClientSwift/Source/SocketTypes.swift'
**<snip>**
<unknown>:0: error: no such file or directory: '/Users/pzurek/dev/ios/sockets/socket.io-client-swift-example/TicTacIOiOS/SocketIOClientSwift/Source/SocketEnginePacketType.swift'
<unknown>:0: error: no such file or directory: '/Users/pzurek/dev/ios/sockets/socket.io-client-swift-example/TicTacIOiOS/SocketIOClientSwift/Source/SocketStringReader.swift'
<unknown>:0: error: no such file or directory: '/Users/pzurek/dev/ios/sockets/socket.io-client-swift-example/TicTacIOiOS/SocketIOClientSwift/Source/SocketIOClientOption.swift'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
I browsed the socket.io-client-swift-example repo and noticed that the SocketIOClientSwift directory references a non-existent project (clicking it leads to a 404 error on github):

So the next thing I did was go to the socket.io-client-swift repo and clone that to my socket.io-client-swift-example/TicTacIOiOS directory. Then I renamed it from socket.io-client-swift to SocketIOClientSwift since that is where Xcode was originally claiming it couldn't find the files.
Next I tried to build socket.io-client-swift-example again and indeed, most of the files are now found (the majority of error messages related to files not being found have disappeared). However, I am still getting errors about three missing files:
<unknown>:0: error: no such file or directory: '/Users/pzurek/dev/ios/sockets/socket.io-client-swift-example/TicTacIOiOS/SocketIOClientSwift/Source/SocketClientSpec.swift'
<unknown>:0: error: no such file or directory: '/Users/pzurek/dev/ios/sockets/socket.io-client-swift-example/TicTacIOiOS/SocketIOClientSwift/Source/SocketFixUTF8.swift'
<unknown>:0: error: no such file or directory: '/Users/pzurek/dev/ios/sockets/socket.io-client-swift-example/TicTacIOiOS/SocketIOClientSwift/Source/SwiftRegex.swift'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
I've tried searching both repos for those files but I cannot find them. Any advice on how to proceed?
Thanks.
This actually isn't a big deal. You can probably ignore it. The examples are simply enough to follow and I was able to get some networking going between a couple apps pretty easily. I just thought I'd bring it to your attention. Feel free to close it.
Same. I am new to iOS programming so this error is really confusing and I don't know what to do haha. Any fix for this would be greatly appreciated!
Hi ! I've managed to build and run the application going through some steps ^^
First, in the TicTectIOiOS folder, run git clone [email protected]:socketio/socket.io-client-swift.git SocketIOClientSwift
. It will clone the socketIO client into the SocketIOClientSwift folder.
Then, you will still have some files missing :
- In the WebSocket folder, under SocketIOClientSwift/Source/ add the two files into the xcode project by dragging and dropping them in the SocketIOClientSwift group.
- Do the same thing for the file named SocketIOClientSpec.swift (in the SocketIOClientSwift/Source/ folder)
- Create a file named URLEncode.swift under the SocketIOClientSwift group, and put the following String's extension in the file :
import Foundation
extension String {
func urlEncode() -> String? {
let result = self.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet());
return result;
}
}
- Lastly, remove the references of the files highlighted in red from the project, and it should build and run like a charm :)
Have fun !
PS: Little tip for playing : share your Mac's connection and connect your iPhone to it, that way you will be able to connect to your server using the lastly created LAN using the IP of your iPhone's router described in your phone's Wifi settings (the router is actually your Mac in this case :) ). That way you can also run another instance of the app with the simulator, connect it to the same IP and voilà ! You can play with yourself :)
I also meet, how to slove
i just dragged these files from the socket.io repo
And how to solve this?
Does anyone have an idea, that can we increase the number of rows (no. of buttons in a row)if we want?? your answer will be appreciated Thank you in advance