架构 arm64 的重复符号(Xcode 错误)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32159983/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:42:48  来源:igfitidea点击:

duplicate symbols for architecture arm64 (Xcode error)

iosxcodeadmobarm64mach-o

提问by Merc

I deleted all reference to GoogleMobileAdsSDKiOS-7.1 from my project and added 7.4.1. When I ran app on simulator everything works fine but when running on device I get App Mach-O Linker Error.

我从我的项目中删除了对 GoogleMobileAdsSDKiOS-7.1 的所有引用并添加了 7.4.1。当我在模拟器上运行应用程序时,一切正常,但在设备上运行时,出现应用程序 Mach-O 链接器错误。

 duplicate symbol l017 in:
/Users/ib/Desktop/Monster  GoogleAds7.4.1/GoogleMobileAdsSdkiOS- 7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADAdNetworkJavaScriptAdViewDelegate.o)
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADRewardBasedVideoAd+Mediation.o)
duplicate symbol l018 in:
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADMRAIDPicture.o)
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADRewardBasedVideoAd+Mediation.o)
duplicate symbol l016 in:
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADBannerAdViewDelegate.o)
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADAdAppViewController.o)
duplicate symbol l021 in:
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADLocation.o)
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADNativeAdAttribution.o)
 duplicate symbol l016 in:
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADBannerAdViewDelegate.o)
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADNativeAdImage.o)
 duplicate symbol l005 in:
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADMWebViewRenderedChecker.o)
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADAdViewRenderedChecker.o)
 duplicate symbol l006 in:
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADMWebViewRenderedChecker.o)
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADAdViewRenderedChecker.o)
 duplicate symbol l012 in:
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADPinger.o)
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADCSIReporter.o)
 duplicate symbol l016 in:
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADBannerAdViewDelegate.o)
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADAdNetworkJavaScriptAdViewDelegate.o)
 duplicate symbol l021 in:
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADLocation.o)
/Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADMRAIDResizeProperties.o)
 ld: 21 duplicate symbols for architecture arm64
 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I know this error means I have duplicates of the above but my problem is where in Xcode 6.1 do I find these duplicates so I can delete them? I've looked in info.plist, build settings, can't find any duplicates. Where in Xcode 6.1 are the duplicates located ?

我知道此错误意味着我有上述重复项,但我的问题是在 Xcode 6.1 中我在哪里找到这些重复项以便我可以删除它们?我查看了 info.plist,构建设置,找不到任何重复项。Xcode 6.1 中的重复项位于何处?

回答by Kyle Liu

Try remove the "-ObjC" linker flag from the "Other Linker Flags" section of build settings.

尝试从构建设置的“其他链接器标志”部分删除“-ObjC”链接器标志。

回答by Quentin

Had the same issue, here is how I "solved" it: simply give up on 7.4.1

有同样的问题,这是我“解决”它的方法:干脆放弃 7.4.1

The issue goes away if you go back to an earlier version: https://dl.google.com/googleadmobadssdk/googlemobileadssdkios-7.3.1.zip

如果您返回到早期版本,问题就会消失:https: //dl.google.com/googleadmobadssdk/googlemobileadssdkios-7.3.1.zip

I do not know if I did anything wrong, but I'll take a wild guess and put the blame on Google on this one. It is likely nobody bothered testing the arm64 build of this framework.

我不知道我是否做错了什么,但我会大胆猜测并将责任归咎于谷歌。可能没有人费心测试这个框架的 arm64 构建。

No matter how much time I spent trying to tweak it it would always fail, while for some reason the 32bits version would work fine.

无论我花了多少时间尝试调整它,它总是会失败,而出于某种原因,32 位版本可以正常工作。

Since you need both 32 and 64 to work in order to push an ipa to the iTunes store, we'll have to do with the previous version.

由于您需要同时使用 32 和 64 才能将 ipa 推送到 iTunes 商店,因此我们将不得不使用以前的版本。

Hope this will save other the pain I had to go through.

希望这能拯救其他人我不得不经历的痛苦。

回答by dgatwood

I have a feeling you're somehow still getting the old framework linked into your app in addition to the new one, but I'm not certain of that. Take a look at the build log and see what exact ld command is being used to link things together.

我有一种感觉,除了新框架之外,您仍然以某种方式将旧框架链接到您的应用程序中,但我不确定这一点。查看构建日志,看看使用什么确切的 ld 命令将事物链接在一起。