可可豆0.38.2 AFNetworking添加为扩展



我从https://stackoverflow.com/a/29335471/3628317答案中做出步骤。一切都很好,但现在我更新了可可荚,看起来像"pod install"不生成项目的所有依赖项。

我发现,我需要改变"项目"为"pods_project",但它仍然不工作。

我做错了什么也许我错过了什么?

platform :ios, "8.0"
use_frameworks!
def shared_pods
    pod 'AFNetworking'
end
target 'Asd', :exclusive => true do
    shared_pods
end

target 'QuickAsd', :exclusive => true do
    shared_pods
end

post_install do |installer_representation|
    installer_representation.pods_project.targets.each do |target|
        if target.name == "Pods-QuickAsd-AFNetworking"
            target.build_configurations.each do |config|
                config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'AF_APP_EXTENSIONS=1']
            end
        end
    end
end

看起来在新的pod(0.38.2)和AFNetworking(2.5.4)版本中,您不必执行链接中描述的步骤来修复AFNetworking的问题。

  1. if target.name == "Pods-QuickAsd-AFNetworking"更改为if target.name == "AFNetworking"
  2. 删除pod init命令创建的所有东西,从头开始重新进行所有pod初始化
  3. 运行pod install与您更新的Podfile
  4. 打开.xcworkspace文件,清理并重建项目

这对我有用。不需要任何其他步骤

最新更新