Apparently I have managed to build my project in Xcode 9 beta and now I only get the error
Module compiled with swift 4.0 cannot be imported in swift 3.1<
I had the same problem and cleaning the build folder helped:
Command+Option+Shift+K
or
Product -> Option+Clean
Product
Option+Clean