0

Update: I solved the question. Please see my answer below (underneath the question and comments).

This question was marked as a duplicate, but it's different because it is a brand new error that I couldn't find through any searches.


I tried installing Alamofire into my XCode project.

As per their their tutorial, I installed cocoapods onto my system. I then navigated to the folder of my existing xcode project in the terminal, and did:

pod init

I then edited the new pod file and added:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target 'RainyShinyCloudy' do
    pod 'Alamofire', '~> 4.4'
end

Finally, I executed the command:

pod install

My terminal told me the install was successful.

But when I opened the .xcworkspace, made a new swift class and tried to import Alamofire, I got this error:

enter image description here

One possible reason could be that I had tried to install an earlier version of alamofire earlier, deleted it and then installed this.

But I really don't know how that could have mattered.

Thanks for any help you guys can give me.

James Dorfman
  • 1,740
  • 6
  • 18
  • 36
  • Possible duplicate of ["No such module 'Alamofire'" Xcode won't recognize Alamofire framework](https://stackoverflow.com/questions/36417151/no-such-module-alamofire-xcode-wont-recognize-alamofire-framework) – Sohil R. Memon Jun 17 '17 at 18:59
  • Please check the above answer. It has already been solved and if's not do comment there! – Sohil R. Memon Jun 17 '17 at 18:59
  • I believe my issue is different than the others. Their errors are all in the form of "No such module 'Alamofire' While mine says cannot load 'Alamofire'. It could be similar, but I already tried their solutions they did not work for me. – James Dorfman Jun 17 '17 at 19:04
  • Run it, it will detect atrun time.. – Salman Ghumsani Jun 17 '17 at 19:05
  • When I run it, the build just fails because of the error – James Dorfman Jun 17 '17 at 19:07
  • Clean (CMD + SHIFT + K) and just build (CMD + B) - try this out! – Sohil R. Memon Jun 17 '17 at 19:13
  • Thanks for the advice. I tried this along with answers all over stack overflow many times, but they have not worked. I even set Build Active Architectures Only = YES, as was suggested by many answers, but that didn't work either. – James Dorfman Jun 17 '17 at 19:17
  • Possible duplicate of [Cannot install Alamofire in new Xcode Project. "No Such module Alamofire"](https://stackoverflow.com/questions/25817479/cannot-install-alamofire-in-new-xcode-project-no-such-module-alamofire) – Sergey Grischyov Jul 03 '17 at 10:01

2 Answers2

3

Actually it failed because you were trying to import AlamoFire and not Alamofire. Imports are case sensitive.

Jon Shier
  • 12,200
  • 3
  • 35
  • 37
2

Update: I posted an answer earlier that was wrong.

But now I actually figured it out.

I made a new project, went to the settings menu by clicking on the name of my app in the project explorer.

Then I went to Linked frameworks and libraries which is at the very bottom of the General tab.

I pressed that little + icon, selected Alamofire.framework. and set the status to required

Following this, cleaning and rebuilding the project made the error go away.

James Dorfman
  • 1,740
  • 6
  • 18
  • 36