I'm on step 5 of the Using Endpoints in an iOS Client tutorial and when I try to generate all the header and implementation classes for iOS by utilizing the tictactoe-v1-rpc.discovery file it's currently failing with "ERROR: Failed to fetch the api description" (see below)
In the terminal I enter:
ConfusedDeer-mbp:/ ConfusedDeer$ /Users/ConfusedDeer/Library/Developer/Xcode/DerivedData/ServiceGenerator-eoemzskhioxhvgbxjfcwxowhamno/Build/Products/Debug/ServiceGenerator \ ~/Desktop/tictactoe-v1-rpc.discovery --outputDir /Users/ConfusedDeer/Desktop/API
===============================================================================
Generation Settings:
Output Directory:
~/Desktop/API
Discovery RPC URL: https://www.googleapis.com/rpc?prettyPrint=false
Flags:
Use service name directory: NO
Remove unknown files: NO
Add 'Generated' directory: NO
Allow rootURL overrides: YES
Loading API File(s):
- Fetching / ~/Desktop/tictactoe-v1-rpc.discovery
ERROR: Failed to fetch the api description / ~/Desktop/tictactoe-v1-rpc.discovery, error: Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo=0x7fec72c2cf30 {NSUnderlyingError=0x7fec72c2c680 "The requested URL was not found on this server.", NSErrorFailingURLStringKey=file:///%20~/Desktop/tictactoe-v1-rpc.discovery, NSErrorFailingURLKey=file:///%20~/Desktop/tictactoe-v1-rpc.discovery, NSLocalizedDescription=The requested URL was not found on this server.}
Generating:
Writing:
- No changes from what is already on disk.
ConfusedDeer-mbp:/ ConfusedDeer$
After further troubleshooting I was finally able to generate my iOS client libraries!
The command I used to accomplish this was:
There were two issues with the original command I was using. I was finally able to locate the issue by placing:
In the browser URL and noticed there was a %20, which is a space. Once I removed all the spaces and the tilde (~) and placed the following in the URL
once the rpc.discovery file appeared in the browser I realized that the google commmand line tool would be able to locate it. Another issue was the output directory had to be relative (duh!) from where I executed the command in the terminal..
After I ran:
in generated the following:
SUCCESS!