Search code examples
iosswiftserver-sidevapor

Server-side swift Vapor - redefinition of module Error


I am new to Vapor and server-side swift and have some trouble setting it up. When I follow the documentation of Vapor about how to set it up, can be found here everything works as expected in the terminal but when I try to build it, there are a lot of errors, as you can see in the attached screenshot. Image of the errors showing in Xcode.

I have tried to delete Xcode and reinstall it and spending some hours trying to find a solution on google. I did not find something that solved this problem.

I have done this multiple times with different projects and have used templates as well as just initializing it with: (The first to code snippets to not generate any errors)

vapor new ProjectName

And then opening it in Xcode using

vapor Xcode

When I am in the right folder. I have also tried to build it from the terminal using this command but similar error appears:

vapor build

This as well is runned when inside the folder.

Here are the versions that I have:

Vapor: 3.1.10
Homebrew: 2.2.12
Swift: 5.2
MacOS: 10.15.4
Xcode: 11.4

Thanks for your effort!

SOLUTION - THANKS TO 0xTim

Update the homebrew version to 2.2.13 and it works.

You do it using the following command in the terminal

brew update

If you want to check your current version then you could use

brew --version

Thanks for the answer 0xTime!


Solution

  • It's a problem with Homebrew and Xcode's Command Line Tools. If you update to Homebrew 2.2.13, this issue should go away.