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.
-
Alamofire is known to not keep retro compatible versions. – JBarros35 Aug 28 '20 at 18:19
6 Answers
2019 UPDATE
If you have this error and you use 'alamofire5' branch just change Alamofire.request
to AF.request
.

- 4,193
- 1
- 11
- 17
-
1nice one, upgraded to Xcode 10/swift 4.2 and AF broke, this seems to have fixed it. – GordonW Sep 19 '18 at 18:45
-
-
-
do you have any idea about it how can I achieve it? with Alamofire5.? – Abhishek Sep 25 '18 at 09:09
-
@Abhishek well, I do not have any idea right now, but if I will know I will tell you – Said-Abdulla Atkaev Sep 26 '18 at 09:24
-
-
21
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#>)

- 2,497
- 28
- 25
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.

- 649
- 1
- 6
- 17
-
2Alamofire.xcodeproj -> Build Settings -> Build Active Architecture Only : NO ... worked for me since I switched to Debug mode. Thanks, you saved my day ! – Fox5150 Dec 15 '15 at 12:42
-
1I don't know why, but after hours of trying different things, this works, thanks man. – Julio_oa Oct 17 '16 at 02:46
-
@Fox5150 face this issue after change version of Alamofire from 4.8.2 to 5.1.0, so It will not create problem in release time or working of API?? – raavan199 Aug 26 '20 at 10:58
Alamofire.xcodeproj -> Build Phases -> Complie Sources
If (0 item), then "[+] Alamofire.swift".
It's OK :)

- 104
- 2
-
19Could you elaborate more your answer adding a little more description about the solution you provide? – abarisone Mar 25 '15 at 07:24
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.
I selected my project name then the project then.
- Clean Cmd+shit+K
- Build Cmd+B
Strangely enough this worked for me. Good Luck!

- 3,393
- 5
- 44
- 59
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)
}

- 16,575
- 7
- 58
- 66
-
Hi @user3579107, did you end up solving your problem? If this answer helped you, could you mark it as such to be a good community user? Cheers. – cnoon Mar 08 '15 at 17:29