更新可可豆荚后xcode重复符号架构错误 [英] xcode duplicate symbols for architecture error after updating cocoa pods

查看:23
本文介绍了更新可可豆荚后xcode重复符号架构错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的 podFile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'AFNetworking'
pod 'ODSAccordionView', '0.4.4'
pod 'IQKeyboardManager'
pod 'NYXImagesKit', :git => 'https://github.com/Nyx0uf/NYXImagesKit.git'
pod 'PEPhotoCropEditor'
pod 'CocoaAsyncSocket'
pod 'PKRevealController'
pod 'Haneke', '~> 1.0'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'RadioButton'

长期以来,一切都运行良好,但现在,当我更新我的 pod (pod update) 时,这 3 个 pod 会更新:

Everythig has been working fine for a long time, but now, when I update my pods (pod update) these 3 pods get uptated:

  • AFNetworking
  • CocoaAsyncSocket
  • IQKeyboardManager

在那之后,什么都没有了.

After that, nothing works anymore.

我收到了 600 多个 duplicate symbols for architecture i386 错误,比如这个:

I get more than 600 duplicate symbols for architecture i386 errors, like this one:

duplicate symbol _OBJC_IVAR_$_AFHTTPRequestOperation._responseSerializer in:
/Users/myuser/Library/Developer/Xcode/DerivedData/MyProject-emjexnnjljambodthokzwpwcddhz/Build/Products/Debug-iphonesimulator/libPods-AFNetworking.a(AFHTTPRequestOperation.o)
/Users/myuser/Library/Developer/Xcode/DerivedData/MyProject-emjexnnjljambodthokzwpwcddhz/Build/Products/Debug-iphonesimulator/libAFNetworking.a(AFHTTPRequestOperation.o)
... (661 times the same error but pointing to different duplicated files)
ld: 661 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

有什么想法吗?

完成如下所示的解决方案后,我的项目仅针对 iPad Air 进行编译,我无法再Archive,我仍然得到同样的错误...

EDITED: After doing the solution shown below, my project only compiles for iPad Air and I can not Archive anymore, i still get the same error...

推荐答案

我使用手动重命名所有符号"的方法.我遇到了重复符号 _OBJC_METACLASS_$_PodsDummy_Pods,所以我在 Podfile 中添加了 post_install 以避免重复符号.

I use the 'Manually Rename All of the Symbols' approach. I was experiencing the duplicate symbol _OBJC_METACLASS_$_PodsDummy_Pods and so i added the post_install in the Podfile to avoid the duplicate symbol.

将您的 pod 文件内容替换为手动重命名所有符号"

Replace your pod file content with this to 'Manually Rename All of the Symbols'

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'

post_install do |installer_representation|
    installer_representation.project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited), PodsDummy_Pods=SomeOtherNamePodsDummy_Pods'
        end
    end
end

pod 'AFNetworking'
pod 'ODSAccordionView', '0.4.4'
pod 'IQKeyboardManager'
pod 'NYXImagesKit', :git => 'https://github.com/Nyx0uf/NYXImagesKit.git'
pod 'PEPhotoCropEditor'
pod 'CocoaAsyncSocket'
pod 'PKRevealController'
pod 'Haneke', '~> 1.0'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'RadioButton'

从您的项目中删除以下 pod 项目

Edited : Delete the following pod item's from your project

1.Pods 文件夹

2.Podfile.lock

3.ProjectName.xcworkspace

然后再次安装 pods

And then install the pods again

此钩子允许您对生成的 Xcode 进行任何最后更改在将项目写入磁盘或您可能执行的任何其他任务之前进行项目想表演.

This hook allows you to make any last changes to the generated Xcode project before it is written to disk or any other tasks you might want to perform.

参考 -
1. https://developerinsider.co/cocoapods-remove-duplicate-symbols-errors/
2. http://guides.cocoapods.org/syntax/podfile.html#post_install

这篇关于更新可可豆荚后xcode重复符号架构错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆