简体   繁体   中英

Alamofire not working after upgrading (Swift/Xcode 8)

My earlier version of swift was in 2.2. I have updated Alamofire using different options like

  1. pod 'Alamofire', '~> 4.0'
  2. pod 'Alamofire', :git => ' https://github.com/Alamofire/Alamofire.git ', :tag => '3.5.0'

Whenever I open the workspace, it asks to convert to latest, I opted for swift 2.3. But the Xcode shows the errors below:

  • Header 'Alamofire-Swift.h' not found
  • Could not build Objective-C module 'Alamofire'

and inside Alamofire Cannot convert value of type 'SecTrustResultType' to expected argument type 'UInt32'

I have deleted the files under the folders ~/Library/Developer/Xcode/DerivedData and build again . Same errors display.

What may be the wrong thing I did ?

As per Alamofire documentation it will work only with :

CocoaPods 1.1.0+ is required to build Alamofire 4.0.0+.

I followed following steps and it's working fine :

Open your terminal -

  1. sudo gem update --system
  2. sudo gem install -n /usr/local/bin cocoapods --pre (It will install prerelease version 1.1.0.rc.3 because final version not came yet)
  3. pod setup
  4. pod repo update
  5. remove all pods of your project and install it again ( Comment pod names by # -> Do pod update and again by removing # -> Do pod update )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM