Module 'Alamofire' has no member named 'request'

IosAlamofire

Ios Problem Overview


I'm new to iOS Development, I installed Alamofire as said in README, but I have this error as other users and I don't know how to solve it.

a busy cat

Ios Solutions


Solution 1 - Ios

2019 UPDATE

If you have this error and you use 'alamofire5' branch just change Alamofire.request to AF.request.

Solution 2 - Ios

if you are using new Alamofire 5.xxx then you will use AF instead of Almofire it like that

AF.upload(multipartFormData: <#T##(MultipartFormData) -> Void#>, to: <#T##URLConvertible#>)

AF.request(<#T##url: URLConvertible##URLConvertible#>)

AF.download(<#T##url: URLConvertible##URLConvertible#>)

Solution 3 - Ios

I solved this issue by changing the Build Active Architectures Only settings.

Click on your project in the Project Explorer, select Build Settings, locate Architectures section, and change the Build Active Architecture Only setting to Yes for Debug and No for Release.

Hope this will work for you.

Solution 4 - Ios

Alamofire.xcodeproj -> Build Phases -> Complie Sources

If (0 item), then "[+] Alamofire.swift".

It's OK :)

Solution 5 - Ios

I found this answer and it worked for me:

I had the same problem after installing from cocoapods. Choosing Product | Clean then Product | Build fixed it. enter image description here I selected my project name then the project then.

  • Clean Cmd+shit+K

  • Build Cmd+B Strangely enough this worked for me. Good Luck!

Solution 6 - Ios

Without having the actual project, it is very difficult to tell what the problem is. However, you do have a problem with the code that you have written. This won't compile with the data/string/JSON variable being declared. That "may" be the actual problem. Please try the following and see if that helps.

Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"])
         .response { request, response, data, error in
             println(request)
             println(response)
             println(data)
             println(error)
         }

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser3579107View Question on Stackoverflow
Solution 1 - IosSaid-Abdulla AtkaevView Answer on Stackoverflow
Solution 2 - IosSultan AliView Answer on Stackoverflow
Solution 3 - IosEthan ChenView Answer on Stackoverflow
Solution 4 - Ioston-katsuView Answer on Stackoverflow
Solution 5 - Iosuplearned.comView Answer on Stackoverflow
Solution 6 - IoscnoonView Answer on Stackoverflow