Reputation: 3047
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 podfile -- which is from GitHub page here because the version has been updated. I have also used the Swift 2.0 branch.
Below is the snapshop of the error, my pod file and my terminal post installing the pod
P.S: I want to use cocoapods to install Alamofire. I don't want to download it from github page
Upvotes: 38
Views: 62977
Reputation: 13698
In my case the problem was because of Module Verifier setting. Switched it off. https://developer.apple.com/documentation/xcode/identifying-and-addressing-framework-module-issues
The error sounded like: (fatal) could not build module 'Test'
Upvotes: 0
Reputation: 254
You can start by making sure you open the Xcode workspace file (with the extension .xcodeproj) instead of the project file (with the extension .xcworkspace). The workspace file contains dependencies installed by CocoaPods, and it is necessary to use it to work on your project.
Upvotes: 0
Reputation: 575
For me, solution was to exclude arm64 devices from Pods and Project. Image is in attachment.
Upvotes: 1
Reputation: 250
For absolute newbie just close xcode project and open by the new way. Choose in your folder file which contains extension like this: .xcodeproj and just enjoy you life.
Upvotes: 0
Reputation: 1033
There is only one way to solve this issue.
Quit Xcode.
Delete project's temp files located at /Users/username/Library/Developer/Xcode/DerivedData
Delete ProjectName.xcworkspace
Delete Podfile.lock file and Pods folder Run pod install.
Open the newly created ProjectName.xcworkspace file and build.
credits to Dimitris Bouzikas here
Upvotes: 5
Reputation: 226
go to finder locate the project and navigate to the '.xcworkspace' file. thats where your pods are installed. if you go to your original project '.xcodeproj' you will only the pod debug files. hopes this helps. took me a while to figure out the problem too.
Upvotes: 1
Reputation: 2345
[For future seekers] you could have missed the second step from the below :
Go to Project Setting
$(SRCROOT)/Carthage/Build/IOS/Alamofire.framework
Upvotes: 0
Reputation: 51
Here is what to do:
After you do all things, don't open the file with extension .xcodeproj
but open the file with extension .xcworkspace
Upvotes: 5
Reputation: 1050
Adding Alamo Fire to all of my target's build phases fixed it for me.
Upvotes: 3
Reputation: 2184
As for me worked to change the name of the project. Accidentally put
ProjectNameTests
instead of
ProjectName
No schemas needed if you've configured the names correctly everywhere:
Example of correct Podfile (Alamofire):
'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'ProjectName' do
pod 'Alamofire', '~> 4.7'
end
Upvotes: 0
Reputation: 8138
If clean project/restart xcode/reinstall cocoapods etc, did not work. You can try running Product
-> Build for
-> Testing (cmd + shift + u)
. The build failed but the import worked right after.
Upvotes: 0
Reputation: 1607
I am using swift 3, I fixed this problem by deleting Derived Data
for this project.
Cheers...!!!
Upvotes: 0
Reputation: 2862
After doing @satoshin answer, I also had to check the Shared
box on the right hand side of the Manage Schemes
window.
Upvotes: 1
Reputation: 2374
Have been facing the same problem, following trick resolved the issue
Go to Manage scheme -> Select pod library that is causing issue -> Build
Change back the scheme to project and then run the app, you are good to go
Note: If you don't see the pod library in the scheme, go to Manage scheme and select the pod library that you would like to build.
Upvotes: 3
Reputation: 4244
My problem was solved using these steps :
Clean Project Goto Project > Build Setting > Framework Search Path and add
Upvotes: 3
Reputation: 2840
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.
Upvotes: 5
Reputation: 951
import Alamofire after importing UIKit Then comment it out, build the project first. Uncomment it. (this worked for me, and others, when the other answers did not).
Upvotes: 10
Reputation: 855
The Trick for me was to open the .xcworkspace file rather then the original project file itself.
Upvotes: 78
Reputation: 309
working this:
Scheme -> Manage Schemes... checked Alamofire checkbox → Build Alamofire scheme
and, if you used Playground , you should change settings Playground:
View -> Utilities -> Show File Inspector Platform OSX → iOS
Upvotes: 29
Reputation: 145
Try this one.
For Swift 2.0 there is no need to add Alamofire.xcodeproj into your xcode. Simply copy and paste source folder from https://github.com/Alamofire and you are done.
or if you want to install Alamofire from Cocoapods then try below code.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 2.0'
Upvotes: 9