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

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

问题描述

这是我的 podFile

  source'https: /github.com/CocoaPods/Specs.git'
平台: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'

Everythig已经工作很长时间了但是现在,当我更新我的荚(荚更新)时,这3个荚变得越来越高:




  • AFNetworking

  • CocoaAsyncSocket

  • IQKeyboardManager



之后,没有任何工作了。 p>

我得到超过600个重复符号的架构i386 错误,像这样:

 重复符号_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 ti
ld:661架构i386的重复符号
clang:错误:链接器命令失败,退出代码1(使用-v查看调用)

任何想法?



strong>执行下面所示的解决方案后,我的项目只编译为 iPad Air ,我不能再存档仍然得到相同的错误...

解决方案

我使用手动重命名所有符号的方法。我正在遇到重复的符号 _OBJC_METACLASS _ $ _ PodsDummy_Pods ,所以我在 Podfile中添加了 post_install 以避免重复的符号。



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

 源'https://github.com/CocoaPods/Specs.git'
平台: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'] ='$(继承),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项目



1。 Pods文件夹



2。 Podfile.lock



3。 ProjectName.xcworkspace



然后再次安装pod


此钩子允许您在生成的Xcode
项目进行最后修改之前,将其写入磁盘,或者您可能要
要执行的任何其他任务。


参考 -

1. http://www.developerinsider.in/2016/03/14/cocoapods-remove-duplicate-symbols-errors/

2. http://guides.cocoapods.org/syntax/podfile.html#post_install


Here is my 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'

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.

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)

Any ideas?

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...

解决方案

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.

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'

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

1.Pods Folder

2.Podfile.lock

3.ProjectName.xcworkspace

And then install the pods again

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.

Reference -
1. http://www.developerinsider.in/2016/03/14/cocoapods-remove-duplicate-symbols-errors/
2. http://guides.cocoapods.org/syntax/podfile.html#post_install

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

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