Vapor: Cannot use Vapor swift undex xcode 8.3.3

Created on 16 Aug 2017  路  3Comments  路  Source: vapor/vapor

  • Vapor Version: 2
  • OS: MACOS
  • OS Version: 10.12.6
  • Vapor Toolbox Version: 2.0.4

Expected Behavior

launch xcode, compile and run vapor application

Current Behavior

I installed vapor using this link link:
https://docs.vapor.codes/2.0/getting-started/install-on-macos/
I created a sample of webservice, whith this code in main.swift
import App
let config = try Config()
try config.setup()
let drop = try Droplet(config)
try drop.setup()
drop.get("hello") { request in
return "ok dude"
}
try drop.run()

I followed the instruction to create the xcode project file, from here :
https://docs.vapor.codes/2.0/getting-started/xcode/

then, I run xcode using the xcode project file.
when I compile, I have 2 errors :

HewelWebServices/Sources/Run/main.swift:1:8: No such module 'App'

HewelVaporSwift/HewelWebServices/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/Terminal.swift:126:31: Cannot invoke initializer for type 'posix_spawn_file_actions_t' with no arguments

I use xcode 8.3.3 build : (8E3004b)
vapor build does the job with success.
I can test my Servlet with success, if I build with command line.

How to Reproduce

follow the step I described.

Most helpful comment

It's not a Swift issue. The build fails because an iOS Device or Simulator is selected as the build target. Change that to "My Mac", and the error should go away.

All 3 comments

What version of Swift are you using in Xcode?

It's not a Swift issue. The build fails because an iOS Device or Simulator is selected as the build target. Change that to "My Mac", and the error should go away.

Ugh! I had same issue! Thx for the tip! Pure sweetness now!

Was this page helpful?
0 / 5 - 0 ratings