When Updating to GoogleMobileAdsSDKiOS7.4.1, Apple Mach-O Linker Error in Xcode appears

388 views
Skip to first unread message

iBek

unread,
Aug 21, 2015, 5:42:15 PM8/21/15
to Google Mobile Ads SDK Developers
I wanted to update from 7.1.0 to 7.4.1 for my GoogleMobile ads in Xcode Project. So I moved to trash GoogleMobileAdsSDKiOS7.1.0 and in Xcode's Build Settings next to Framework Search Paths, I removed GoogleMobileAdsSDKiOS7.1.0 from there. Then I added the GoogleMobileAdsSDKiOS7.4.1 to my project and it automatically placed 7.4.1 in FrameworkSearchPaths. I have all the correct linked frameworks in my project that was needed for 7.1.0 and is needed for 7.4.1 because I never had ad issue with 7.1.0. When I build on simulator 7.4.1 everything works fine but when I try to build on actual device I receive Apple Mach-O Linker Error 

clang: error: linker command failed with exit code 1 (use -v to see invocation)

21 Duplicate Symbols for architecture arm64

Linker command failed with exit code 1 (use -v to see invocation)


Also, is it absolutely necessary to update to 7.4.1? I keep getting message in debug area in Xcode to update. I currently use 7.1.0 but all ads seem to work fine on device with 7.1.0. Can I use 7.1.0 if I can't fix the AppleMach-O Linker Error?

Izzy Machado

unread,
Aug 22, 2015, 2:10:48 AM8/22/15
to Google Mobile Ads SDK Developers
Try to update your Xcode to version 6.4 .  I recently just had this issue the other day and was running on Xcode 6.2 then i updated to Xcode 6.4 and the error went away. 

iBek

unread,
Aug 22, 2015, 1:21:46 PM8/22/15
to Google Mobile Ads SDK Developers
I use Xcode 6.1. To update to Xcode 6.4 i'd need Yosemite OSX 10.10.5 my current update i'd need to make. However, the reviews for 10.10.5 are really not good says it slows down the computer and people wish they'd have the version I have. So I don't want performance lag issues on my MacBook Pro. Do you know any other issues I can resolve in Xcode 6.1 to help this  Apple Mach-O Linker Error  to go away?

Elton Kent

unread,
Aug 24, 2015, 4:39:01 PM8/24/15
to Google Mobile Ads SDK Developers
Hi there,
You could get a duplicate symbols error if you have included the framework twice in your project. I would recommend using the cocoapods approach to set up your project as it makes it easy to upgrade to latest versions of the SDK.

Cheers,
Elton Kent 
Mobile Ads SDK Team

iBek

unread,
Aug 24, 2015, 5:32:44 PM8/24/15
to Google Mobile Ads SDK Developers
I realize that. How do I find and remove duplicates if I don't know where the duplicates are located? 

In Linked Frameworks and Libraries  GoogleMobileAds.framework (required) is only there once.
In Build Settings Framework search paths only GoogleMobileAdsSDKiOS7.4.1 reference is there.
In Project Navigator there is only 1 GoogleMobileAdsSDKiOS7.4. folder. When I open that folder I have GoogleMobileAdsSDKiOS-7.4.1 framework and when I open that there are the headers.

I don't see anything that's duplicated.

Elton Kent

unread,
Aug 25, 2015, 10:41:21 AM8/25/15
to Google Mobile Ads SDK Developers
Hi,
Have you considered using the cocoapods approach? We have had users with similar issues resolve this problem when they switched to using cocoapods.

Thanks,
Elton Kent
Mobile Ads SDK Team

iBek

unread,
Aug 25, 2015, 11:46:01 AM8/25/15
to Google Mobile Ads SDK Developers
From the GET STARTED on AdMob page it says there are 2 ways to add Google Mobile Ads SDK into Xcode project, one is cocoapods and the other is manually. I started doing this manually but for my next project i'll do cocoa pods. How do I fix my issue manually? 

Can I just use GoogleMobileAdsSDKiOS-7.1 and will it work. I tested live ads and they're showing up so would Google pay me with 7.1 if I put that up in app store now? Or is it a must to update to 7.4.1?

Elton Kent

unread,
Aug 25, 2015, 5:31:53 PM8/25/15
to Google Mobile Ads SDK Developers
Hi there,
The only reason I can think of behind the duplicate symbols error is having the same framework added twice. Have you tried creating a fresh project and re-importing your project files?

Cheers,
Elton Kent
Mobile Ads SDK Team

Usman Abbas

unread,
Aug 27, 2015, 4:27:49 PM8/27/15
to Google Mobile Ads SDK Developers
21 Duplicate Symbols for architecture arm64

troubleshoot this with easy 4 steps

1)  check your project directory for adding duplicate googleMobileAdsSDK, right click on your project and show in finder

2)  goto project -> build settings -> (search for) Library Search Paths (and check the library path is correct and if old SDK path is there remove it from there)

3)  goto project -> build phase -> Link binary with Libraries , and check if the old google SDK exist remove it from there

4)  delete your app from device project clean short key ( cmd+k )

5) run your project 

Hopefully it helps you

raha...@gmail.com

unread,
Sep 12, 2015, 12:16:23 PM9/12/15
to Google Mobile Ads SDK Developers

Hi,
I ran into a similar problem last night. I upgraded the lib from 7.3.1 to 7.4.1 and have duplicate symbol errors.
I use XCode 6.1.1 and I use the framework directly (no cocoapods). If I revert the lib back to 7.3.1 it works.
We are not in a position to upgrade to XCode 6.4 or swich to cocoapods at this point as has been suggested previously

Is the new version meant to work only with XCode6.4 or cocoapods?
Thanks
Rahat Modi

duplicate symbol l017 in:

    .........../GoogleMobileAds.framework/GoogleMobileAds(GADAdNetworkJavaScriptAdViewDelegate.o)

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADRewardBasedVideoAd+Mediation.o)

duplicate symbol l018 in:

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADMRAIDPicture.o)

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADRewardBasedVideoAd+Mediation.o)

duplicate symbol l016 in:

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADBannerAdViewDelegate.o)

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADAdAppViewController.o)

duplicate symbol l021 in:

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADLocation.o)

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADNativeAdAttribution.o)

duplicate symbol l016 in:

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADBannerAdViewDelegate.o)

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADNativeAdImage.o)

duplicate symbol l005 in:

 .........../GoogleMobileAds.framework/GoogleMobileAds(GADMWebViewRenderedChecker.o)

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADAdViewRenderedChecker.o)

duplicate symbol l006 in:

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADMWebViewRenderedChecker.o)

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADAdViewRenderedChecker.o)

duplicate symbol l012 in:

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADPinger.o)

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADCSIReporter.o)

duplicate symbol l016 in:

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADBannerAdViewDelegate.o)

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADAdNetworkJavaScriptAdViewDelegate.o)

duplicate symbol l021 in:

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADLocation.o)

     .........../GoogleMobileAds.framework/GoogleMobileAds(GADMRAIDResizeProperties.o)

ld: 67 duplicate symbols for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Elton Kent

unread,
Sep 14, 2015, 5:49:31 PM9/14/15
to Google Mobile Ads SDK Developers
Hi Rahat,
Try removing the -load_all linker flag from the target build settings.

Cheers,
Elton Kent
Mobile Ads SDK

raha...@gmail.com

unread,
Sep 14, 2015, 7:21:17 PM9/14/15
to Google Mobile Ads SDK Developers
Hi Elton
The only settings I have is "-ObjC"

Thanks
Rahat

raha...@gmail.com

unread,
Sep 14, 2015, 7:29:48 PM9/14/15
to Google Mobile Ads SDK Developers
Hi Elton
We have only the -Obj C flag for linking. 
I forgot to mention we use the google analytics and google IMA libraries too. We have had this setup for a few years now.

Thanks
Rahat

Elton Kent

unread,
Sep 15, 2015, 11:43:11 AM9/15/15
to Google Mobile Ads SDK Developers
I see. Lets try this. In your build settings, look for "Framework search paths" and "Header Search Paths" (They should be under the category "search paths"). Under these search paths, make sure that you have not included the same library twice. As mentioned earlier in this thread, setting up your project using cocoapods would streamline framework updates and workspace configuration.

Cheers,
Elton Kent
Mobile Ads SDK Team

Reply all
Reply to author
Forward
0 new messages