CocoaPods没有为AFNetworking下载所有文件

时间:2016-03-22 06:15:05

标签: cocoapods afnetworking-3

最近我的Xcode iOS8 + iPhone项目由于UIButton + AFNetworking.h中的文件未找到错误而停止构建。

错误读取" AFImageDownloader.h"文件未找到。

查看finder中的文件夹,在查看AFNetworking的Git仓库时,它应该在那里丢失一半的文件。因此,当该文件被神奇地添加时,它可能会失败更多

互联网上的所有解决方案都失败了。我试过了: - 从MacBook(El Capitan)完全删除CocoaPods,缓存和主仓库 - Pod安装/更新 - 无需清理 - 我无法忘记的所有命令。 - 删除本地Git,重新安装并重新克隆存储库。

当我的collegae在他的MacBook上安装项目时,它安装和构建就好了。

    platform :ios, '8.0'
    inhibit_all_warnings!

target "censored" do
pod 'BDGShare'
pod 'BDGMacros'
pod 'BDGLocation'
pod 'BDGCategories'
pod 'BDGScreenshot'
pod 'BDGImagePicker'

pod 'Lockbox'
pod 'HockeySDK'
pod 'DTCoreText'
pod 'AFNetworking'
pod 'SVProgressHUD'
pod 'DZNEmptyDataSet'
pod 'Google/Analytics'
pod 'TTTAttributedLabel'
pod 'iOS-htmltopdf', '~> 1.0'

end

pod install verbose给了我这个

pod install --verbose
  Preparing

Updating local specs repositories

Updating spec repo `master`
  $ /usr/bin/git pull --ff-only
  Already up-to-date.

CocoaPods 1.0.0.beta.6 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.


Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods`: (``)
  Using `ARCHS` setting to build architectures of target `Pods-Censored`: (``)

Resolving dependencies of `Podfile`

Comparing resolved specification to the sandbox manifest
  - AFNetworking
  - BDGCategories
  - BDGImagePicker
  - BDGLocation
  - BDGMacros
  - BDGScreenshot
  - BDGShare
  - DTCoreText
  - DTFoundation
  - DZNEmptyDataSet
  - Google
  - GoogleAnalytics
  - GoogleInterchangeUtilities
  - GoogleNetworkingUtilities
  - GoogleSymbolUtilities
  - GoogleUtilities
  - HockeySDK
  - Lockbox
  - SVProgressHUD
  - TTTAttributedLabel
  - iOS-htmltopdf

Downloading dependencies

-> Using AFNetworking (3.0.4)

-> Using BDGCategories (0.0.8)

-> Using BDGImagePicker (0.0.6)

-> Using BDGLocation (0.0.2)

-> Using BDGMacros (0.0.14)

-> Using BDGScreenshot (0.0.2)

-> Using BDGShare (0.0.9)

-> Using DTCoreText (1.6.17)

-> Using DTFoundation (1.7.9)

-> Using DZNEmptyDataSet (1.7.3)

-> Using Google (1.3.2)

-> Using GoogleAnalytics (3.14.0)

-> Using GoogleInterchangeUtilities (1.1.0)

-> Using GoogleNetworkingUtilities (1.0.0)

-> Using GoogleSymbolUtilities (1.0.3)

-> Using GoogleUtilities (1.1.0)

-> Using HockeySDK (3.8.6)

-> Using Lockbox (3.0.0)

-> Using SVProgressHUD (1.1.3)

-> Using TTTAttributedLabel (1.13.4)

-> Using iOS-htmltopdf (1.0.3)
  - Running pre install hooks

Generating Pods project
  - Creating Pods project
  - Adding source files to Pods project
  - Adding frameworks to Pods project
  - Adding libraries to Pods project
  - Adding resources to Pods project
  - Linking headers
  - Installing targets
    - Installing target `AFNetworking` iOS 8.0
    - Installing target `BDGCategories` iOS 8.0
    - Installing target `BDGImagePicker` iOS 8.0
    - Installing target `BDGLocation` iOS 8.0
    - Installing target `BDGScreenshot` iOS 8.0
    - Installing target `BDGShare` iOS 8.0
    - Installing target `DTCoreText` iOS 8.0
    - Installing target `DTFoundation` iOS 8.0
    - Installing target `DZNEmptyDataSet` iOS 8.0
    - Installing target `Lockbox` iOS 8.0
    - Installing target `SVProgressHUD` iOS 8.0
    - Installing target `TTTAttributedLabel` iOS 8.0
    - Installing target `iOS-htmltopdf` iOS 8.0
    - Installing target `Pods-Censored` iOS 8.0
  - Running post install hooks
  - Writing Xcode project file to `Pods/Pods.xcodeproj`
    - Generating deterministic UUIDs
  - Writing Lockfile in `Podfile.lock`
  - Writing Manifest in `Pods/Manifest.lock`

Integrating client project

Integrating target `Pods-Censored` (`Censored.xcodeproj` project)
  - Running post install hooks
    - cocoapods-stats from
    `/Library/Ruby/Gems/2.0.0/gems/cocoapods-stats-0.6.2/lib/cocoapods_plugin.rb`

Sending stats
      - AFNetworking, 3.0.4
      - BDGCategories, 0.0.8
      - BDGImagePicker, 0.0.6
      - BDGLocation, 0.0.2
      - BDGMacros, 0.0.14
      - BDGScreenshot, 0.0.2
      - BDGShare, 0.0.9
      - DTCoreText, 1.6.17
      - DTFoundation, 1.7.9
      - DZNEmptyDataSet, 1.7.3
      - Google, 1.3.2
      - GoogleAnalytics, 3.14.0
      - GoogleInterchangeUtilities, 1.1.0
      - GoogleNetworkingUtilities, 1.0.0
      - GoogleSymbolUtilities, 1.0.3
      - GoogleUtilities, 1.1.0
      - HockeySDK, 3.8.6
      - Lockbox, 3.0.0
      - SVProgressHUD, 1.1.3
      - TTTAttributedLabel, 1.13.4
      - iOS-htmltopdf, 1.0.3
  Pod installation complete! There are 15 dependencies from the Podfile and 21
  total pods installed.

1 个答案:

答案 0 :(得分:0)

我不确定该解决方案是否特别适用,但是我尝试了此方法并奏效了:

rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update

基本上删除CocoaPods的缓存,然后删除Pods文件,然后重新安装。

来源:https://gist.github.com/mbinna/4202236