Alamofire No Such Module (CocoaPods)

后端 未结 17 1623
借酒劲吻你
借酒劲吻你 2020-12-09 15:26

Using Xcode 7

I am trying to install Alamofire in a sample project. Have used the instructions from Ray Wenderlich\'s page

Only change from above link is the

17条回答
  •  臣服心动
    2020-12-09 15:45

    For reference to anyone who comes across this problem in the future:

    Swift 2.x + CocoaPods 1.x

    Symptoms: build works in Xcode for debug configuration but fails when xcodebuild is executed from console using pod lib lint or similar command. The result is error: no such module 'X'

    Solution: In MyProject.podspec add your dependencies without specifying versions:

    spec.dependency "Alamofire"
    

    The Podfile should also contain the same dependencies. Then run:

    $ pod install && open MyProject.xcworkspace
    

    You should open .xcworkspace instead of .xcodeproj. The build will now work in both Xcode and console and pod lib lint passes validation.

    I wrote this because I was trying to publish a new CocoaPods pod library and had a similar issue but found no answer and also because Google leads to this question.

提交回复
热议问题