Alamofire インストール時のcocoapodエラー

2018年8月3日 Posted by PURGE

久しぶりに、swift で iOSの開発。
Podfile に以下を記述した。

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

target 'MyProject' do
    pod 'Alamofire', '~> 4.7'
end

cocoaPod で Alamofireインストールしようとしてエラーが発生。

$ pod install
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Alamofire":
  In Podfile:
    Alamofire (~> 4.7)

None of your spec sources contain a spec satisfying the dependency: `Alamofire (~> 4.7)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

指示に従い pod repo update を実行して、pod install を再実行。

$ pod repo update
Updating spec repo `master`
Performing a deep fetch of the `master` specs repo to improve future performance

  $ /usr/bin/git -C /Users/xxx/.cocoapods/repos/master fetch origin
  --progress
  remote: Counting objects: 117, done.        
  remote: Compressing objects: 100% (111/111), done.        
  remote: Total 117 (delta 73), reused 0 (delta 0), pack-reused 0        
  Receiving objects: 100% (117/117), 12.89 KiB | 3.22 MiB/s, done.
  Resolving deltas: 100% (73/73), completed with 40 local objects.
  From https://github.com/CocoaPods/Specs
     1a871e6f9db..69b321bd0a4  master     -> origin/master
  $ /usr/bin/git -C /Users/xxx/.cocoapods/repos/master rev-parse
  --abbrev-ref HEAD
  master
  $ /usr/bin/git -C /Users/xxx/.cocoapods/repos/master reset --hard
  origin/master
  Checking out files: 100% (285048/285048), done.
  HEAD is now at 69b321bd0a4 [Add] ADMobGenSMA 0.1.1
warning: inexact rename detection was skipped due to too many files.

再度、インストール。

$ pod install
Analyzing dependencies
Downloading dependencies
Installing Alamofire (4.7.3)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `Sample.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です