Can't get AdMob for Unity to build for iOS

787 views
Skip to first unread message

ch...@marinacci.com

unread,
Jan 4, 2018, 3:10:37 PM1/4/18
to Google Mobile Ads SDK Developers
I'm not able to get AdMob for Unity to compile when building an iOS program in XCode. This does work in Android builds, so this problem appears to be specific to iOS.

Software used  (Windows):

Windows 10 Pro version 1709, build 16299.125
Unity Pro 2017.3.0f3
Google Mobile Ads Unity Plugin v3.10.0

Software used (Mac):

macOS 10.13.2
XCode 9.2
CocoaPods (latest version)

Hardware used:

Windows PC
MacBook Pro

Steps:

Start on the Windows PC.
Create a new Unity 2D project.
Import the Google Mobile Ads Unity Plugin package.
Set the build platform to iOS.
In the Unity Build Settings for iOS, add a valid Bundle Identifier and Automatic Signing Team ID.
Build the project.
Share the project folder over the local network.
Switch to using the Mac.
Connect to the shared folder.
Load the generated XCode workspace/project (XCode doesn't appear to give you a choice here) into XCode.
Try to build it.
You will get the following error in GADUNativeCustomTemplateAd.h:
"'GoogleMobileAds/GoogleMobileAds.h' file not found"

Please let me know if you need any more information and/or if you have a workaround. 

Thanks,

Chris

Ivan Bautista (Mobile Ads SDK Team)

unread,
Jan 5, 2018, 12:45:46 AM1/5/18
to Google Mobile Ads SDK Developers
Hi Chris,

Do you also encounter the build issue when you generate the XCode workspace/project in your Mac? Could you share with us privately (using Reply privately to author option) the entire project folder generated so we can check on our end?

Regards,
Ivan Bautista
Mobile Ads SDK Team

Sherlin Antoine

unread,
Jan 30, 2018, 4:01:57 AM1/30/18
to Google Mobile Ads SDK Developers
Hi there Ivan,

I seem to encounter the the exact issue when attempting to build the generated XCode project. I developed the project on Unity from a pc and I noticed in the console after the XCode is generated it says: 
"Cocoapod installation is disabled.If Cocoapods are not installed in your project it will not link." I believe this is the root of the problem but I can't seem to resolve this.

Thank you for your time,
Sherlin Antoine


Ram Parameswaran (Mobile SDK Team)

unread,
Jan 30, 2018, 2:14:14 PM1/30/18
to Google Mobile Ads SDK Developers
Hey Sherlin,

iOS dependencies (ie. the GMA iOS SDK) are identified using CocoaPods and included in the generated Xcode. When building on Windows, Cocoapods cannot be used and automatic dependency resolution cannot be performed. As a workaround you can manually include the GMA iOS SDK in the `Assets/Plugins/iOS` directory of your Unity project.

- Ram

Sherlin Antoine

unread,
Jan 30, 2018, 5:06:30 PM1/30/18
to Google Mobile Ads SDK Developers
Thanks Ram, for explaining and providing the solution.
Reply all
Reply to author
Forward
0 new messages