Unity to iOS: XCode Build Failed - Apple Mach-O Linker Error

1,140 views
Skip to first unread message

Dakattack

unread,
Jul 16, 2017, 10:52:48 AM7/16/17
to Google Mobile Ads SDK Developers




I've been attempting to build my Unity game on iOS using Admob, Firebase analytics, and Unity IAP. But I've been running into linker errors that seem to be concerning admob. 
  • Unity Version: 5.6.2f1 Personal
  • Xcode Version: 8.3.3

Steps I've completed:

  1. Enabled IAP and Analytics in Unity Service tab, Imported IAP package
  2. Imported Firebase Analytics Package
  3. Imported Admob unity package
  4. Created new Firebase project in the web portal. Downloaded GoogleService-Info.plist file
  5. Put .plist file in Assets/Plugins folder.
  6. Downloaded GoogleMobileAdsSDK.framework. Placed it under Assets/Plugins/iOS
  7. Ensured my player settings in Unity were correctly configured (Bundle Identifier, Version, IL2CPP set, Architecture: Universal, Device SDK set).
  8. Made Xcode project folder (Release mode set in build settings). Build succeeded, no errors.
  9. Opened terminal window and ran "pod init" in Xcode project folder root
  10. Ran "pod 'Firebase/Core'", "pod install". Succeeded
  11. Opened the .xcworkspace file from Xcode
  12. Changed "Enable Modules (C and Objective-C)" to "Yes" in Build Settings for both target and project files.
  13. All required frameworks (including GoogleMobileAdsSDK) seemed to already be included. Frameworks
  14. Added "-ObjC" to "Other Linker Flags" in both Target and Project files.
  15. Cleaned Project
  16. Build Project, Build failed due to linker errors

I've also tried upping the deployment target to 8.0 rather than 6.0 in the general settings and PodFile, but it didn't remove the errors.

Any help would be appreciated. I think I'm just missing a step somewhere in the Xcode configuration but I can't seem to figure it out.

Dakattack

unread,
Jul 16, 2017, 11:01:55 AM7/16/17
to Google Mobile Ads SDK Developers
Note: I'm using the most recent version of the plugins mentioned. 
GoogleMobileAdsSDK, 7.21.0
Google Admob Package (Unity) 3.6.0 - Found Here
Firebase Unity SDK 4.0.2
The Unity IAP package is 1.11.4 according to the changelog file.

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Jul 17, 2017, 2:44:04 AM7/17/17
to Google Mobile Ads SDK Developers
Hi there,

Do note that as of 7.20.0 of the Mobile Ads SDK for iOS, the in-app purchase Ad format has been removed. 

That said, I am not able to replicate the issue using the steps you provided. Can you provide us a sample Unity project where you can replicate the issue? Additionally, can you replicate the issue when you try to build from our sample apps?

Regards,
Joshua Lagonera
Mobile Ads SDK Team

Dakattack

unread,
Jul 17, 2017, 7:39:41 AM7/17/17
to Google Mobile Ads SDK Developers
Hi Joshua, thanks for the reply

I was talking about the Unity in-app purchase package, I am not using the in-app purchase ad format; just to clarify.

Link to the zip file on dropbox. I was having trouble using the "Attach a file" option.

Thanks again for the help!

Dakattack

unread,
Jul 17, 2017, 11:15:22 PM7/17/17
to Google Mobile Ads SDK Developers
Solved the issue! Turns out I had accidentally downloaded and imported a unofficial google admob package on github. This added a "AdmobAPI" folder to my Assets/Plugins folder that contained files related to the issue at hand.

Whenever I would re-import the official google admob package, I just assumed that this folder was a part of it and was getting overwritten every time. But the folder would remain in tact with the broken files because it wasn't part of the official package. I noticed it the issue when implementing the same setup I had into the Google sample project and compared the assets.

Thanks again! 

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Jul 17, 2017, 11:35:39 PM7/17/17
to Google Mobile Ads SDK Developers
Hi there,

Glad you were able to resolve the issue and provide a solution for future users!

Feel free to get back to us if you are having issues with the Mobile Ads SDK and we will be glad to assist you.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

Waqas Akbar

unread,
Sep 26, 2017, 8:16:31 AM9/26/17
to Google Mobile Ads SDK Developers
Hi Dakattack, 

i am having the same issue, i have latest package of admob, trying to convert the game for iOS. Did you mean that you have deleted the AdmobAPI folder or you just put it outside the plugins folder.. i cannot delete this folder as there are other scripts for the ads associated with this folder. I am waiting for your precious reply. Thanks  
Reply all
Reply to author
Forward
0 new messages