You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry,I just see the email,Now,how to the error was solved,
TARGETS->Build Phases->Embed Frameworks
when you add the framework of Alamofire2.0,
Xcode will take three frameworks,iphoneos ,xos,watchos,
please delete the xos,watchos,save the iphoneos,
when you run the app,the error was solved~!!
Happy Mid Autumn Festival
This problem seems to (also) occur when you try to construct a url using optionals:
letusername:String?="mattt"letrequest=Alamofire.request(.GET,"http://localhost/user/\(username)").responseJSON{ response in
// ...
}
The solution is obvious; make sure you unwrap any optionals using guard, if-let or by implicitly unwrapping them before constructing your url.
My guess is that Carthage builds the Alamofire framework with the Release configuration (by default) for which optimizations are enabled, which results in the error message mentioned in the initial post instead of a more descriptive message. Could be wrong about this though ¯_(ツ)_/¯
Just incase anyone else is getting: error: Alamofire was compiled with optimization - stepping may behave oddly; variables may not be available.
I was getting that error when constructing a URL for google geo services. I was appending a street address to the end of the URL WITHOUT encoding the street address itself first.
My Solution:
var streetAdress = "123 fake street, new york, ny"
var escapedStreetAddress = streetAddress.stringByAddingPercentEncodingWithAllowedCharacters(.URLHostAllowedCharacterSet())
let url = "(self.baseUrl)&address=(escapedAddress!)"
That fixed it for me! It didnt like that the address had spaces and commas, etc.
hi friends i have fetch same problem "Alamofire was compiled with optimization - stepping may behave oddly; variables may not be available."
But , I was Fixed it Check your url string Pass Url Without any SPACE
Activity
ylj798 commentedon Sep 19, 2015
fixed it
ozgur commentedon Sep 23, 2015
@cnoon how did you fix this? can you help me out. I have the same issue.
mojtabacazi commentedon Sep 24, 2015
Same problem here. Any idea? @mattt
I've checked complier setting and optimizer is set NONE
andrewschreiber commentedon Sep 24, 2015
I ran into the same issue in ReactiveCocoa and running 'carthage build' fixed the problem.
mojtabacazi commentedon Sep 24, 2015
@andrewschreiber I'm using Cocoapods. Any solution for that?
andrewschreiber commentedon Sep 24, 2015
Perhaps a 'pod install'
mojtabacazi commentedon Sep 25, 2015
@andrewschreiber I've tried
pod install
several time. Removed pods completely and add them back. nothing is working.ylj798 commentedon Sep 25, 2015
Sorry,I just see the email,Now,how to the error was solved,
TARGETS->Build Phases->Embed Frameworks
when you add the framework of Alamofire2.0,
Xcode will take three frameworks,iphoneos ,xos,watchos,
please delete the xos,watchos,save the iphoneos,
when you run the app,the error was solved~!!
Happy Mid Autumn Festival
mojtabacazi commentedon Sep 25, 2015
@ylj798 I can't see "Embed Frameworks". BTW, I think I'm in the wrong thread, I'm using AFNetworking not Alamofire
erikvdwal commentedon Sep 28, 2015
This problem seems to (also) occur when you try to construct a url using optionals:
The solution is obvious; make sure you unwrap any optionals using
guard
,if-let
or by implicitly unwrapping them before constructing your url.My guess is that Carthage builds the Alamofire framework with the Release configuration (by default) for which optimizations are enabled, which results in the error message mentioned in the initial post instead of a more descriptive message. Could be wrong about this though ¯_(ツ)_/¯
29satnam commentedon Sep 30, 2015
Same error, PUT isn't working
error: Alamofire was compiled with optimization - stepping may behave oddly; variables may not be available.
Update:
Issue solved.! jobId.text wasn't unwrapped. :)
jakubprusa commentedon Nov 12, 2015
@29satnam life saver !!!, unwraping was also my issue with different library :)
geoherna commentedon Mar 23, 2016
Just incase anyone else is getting: error: Alamofire was compiled with optimization - stepping may behave oddly; variables may not be available.
I was getting that error when constructing a URL for google geo services. I was appending a street address to the end of the URL WITHOUT encoding the street address itself first.
My Solution:
That fixed it for me! It didnt like that the address had spaces and commas, etc.
Hope this helps someone else!
ramrumram commentedon May 11, 2016
man geoherna, you nailed it, yes there was a trailing space in input and your way worked...
davidbjames commentedon May 19, 2016
You got it @geoherna. We had server-provided media URLs with spaces in them, so this fixed it :
arjun011 commentedon Jul 5, 2016
hi friends i have fetch same problem "Alamofire was compiled with optimization - stepping may behave oddly; variables may not be available."
But , I was Fixed it Check your url string Pass Url Without any SPACE