I am trying to import and use the OAuthSwift library in the Swift iOS project. I followed their directions:
- Drag OAuthSwift.xcodeproj to your project in the Project Navigator.
- Select your project and then your app target. Open the Build Phases panel.
- Expand the Target Dependencies group, and add OAuthSwift framework. import OAuthSwift whenever you want to use OAuthSwift.
After completing these steps, importing OAuthSwift using import OAuthSwift
causes the error No such module 'OAuthSwift'
and the project fails to build.
I have tried the following steps, based on a number of other SO questions about similar issues:
- Clean and rebuild
- Add the OAuthSwift framework to many different combinations of
Build Phases > Target Dependencies
,Build Phases > Link Binary With Libraries
,Build Phases > Embed Frameworks
, andGeneral > Embedded Libraries
- Set
Build Settings > Search Paths > Framework Search Paths
andBuild Settings > Search Paths > Library Search Paths
to$(SRCROOT)
and recursive. - Verify that my deployment target matches the deployment target of the
OAuthSwift
Xcode project.
I have tested this using the latest version of OAuthSwift
from their master branch using a git submodule, as well as manually downloading and importing each of the two latest tagged versions (0.6.0 and 0.5.2).
I have also created a brand new Xcode project, imported OAuthSwift as above, and encountered the same error.
Finally, I also tried importing a different Swift Framework (Alamofire), following the steps as stated on the README at https://github.com/Alamofire/Alamofire. This caused the same error as well: No such module 'Alamofire'
.
I am using:
- OSX 10.11.6
- Xcode 7.3.1
- Swift 2.2
I'm still fairly new to Xcode and the Swift module system, so any help or suggestions is appreciated.