7

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.

 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 ?

Merc
  • 313
  • 1
  • 4
  • 10
  • It could be that you've got 21 newly declared variables in each file with the exact same name. – Michael Mooney Aug 22 '15 at 19:39
  • In appdelegate.h for all my files I wrote @property(nonatomic, strong) GADBannerView *adMobView; Is that the issue? I don't understand what you're referring to – Merc Aug 22 '15 at 19:46
  • When I created an UIImageView and called it the same name on multiple files I got this error. So I'm guessing here is that you've created your GADBannerView and called it the same name, adMobView, on 21 files that use it right? Your duplicate symbol is the name. If you wish you can change the name of the GADBannerView for each file (make the name different for each file), but do edit all in scope to make your life much easier. – Michael Mooney Aug 22 '15 at 20:07
  • No, the duplicate symbol names are l016, l021, etc. Besides, property names can be shared across multiple classes. Only global variables share a namespace. – dgatwood Aug 23 '15 at 03:55

3 Answers3

7

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

Kyle L
  • 681
  • 6
  • 9
0

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.

dgatwood
  • 10,129
  • 1
  • 28
  • 49
  • From my Project Navigator, I moved to trash my GoogleMobileAdsSDKiOS7.1, in Build Settings I removed what was from 7.1 in Framework Search Paths. Then added files of 7.4 directly from download page. That automatically added 7.4 reference in Framework Search Paths. What else was I supposed to do? – Merc Aug 23 '15 at 17:10
  • Ostensibly that's right, but obviously something is subtly wrong. Try posting the exact ld line from the build log. – dgatwood Aug 23 '15 at 21:13
  • Where in Xcode do I go to delete the additional framework or SDK 7.1 that's still possibly hanging on for some reason even though I don't see it anywhere in project. – Merc Aug 25 '15 at 16:29
0

Had the same issue, here is how I "solved" it: simply give up on 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

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.

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.

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.

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

Quentin
  • 269
  • 3
  • 9