However I have recompiled the framework using the same Xcode and it still gives me this error.
In my case (Xcode 9.2):
I went to Xcode Preferences > Locations > Derived Data
I then deleted the data and did a clean build and was ok.
Install Xcode Toolchain of specific Xcode version which was working for you from here.
An Xcode toolchain includes a copy of the compiler, lldb, and other related tools needed to provide a cohesive development experience for working in a specific version of Swift.
Open Xcode's Preferences, navigate to Components > Toolchains , and select the installed Swift toolchain.
This will let you compile and run the app for now.