Hi all.
I have been experiencing problems with Admob in a 2D game in Unity. To simplify the issue, I created a new project with nothing but a basic script attached to main camera as follows:
using UnityEngine;
using System.Collections;
using GoogleMobileAds.Api;
public class AdMobScript : MonoBehaviour {
void Start()
{
RequestBanner();
}
private void RequestBanner()
{
#if UNITY_ANDROID
string adUnitId = "<my android adunitid goes here>";
#elif UNITY_IPHONE
string adUnitId = "<my ios adunitid goes here>";
#else
string adUnitId = "unexpected_platform";
#endif
// Create a 320x50 banner at the top of the screen.
BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.TopRight);
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the banner with the request.
bannerView.LoadAd(request);
}
}
This is actually the basic example script given here: link text
except I change my adunitids with proper values while testing the script.
When I build the project for IOS, I get the following error:
Could not create a new Xcode project with CocoaPods: Encountered unexpected error while running pod
UnityEngine.Debug:LogWarning(Object)
GoogleMobileAds.Postprocessor:RunPodUpdate(String) (at Assets/GoogleMobileAds/Editor/PostProcessor.cs:60)
GoogleMobileAds.Postprocessor:OnPostprocessBuild(BuildTarget, String) (at Assets/GoogleMobileAds/Editor/PostProcessor.cs:27)
My Unity version is 5.3.6f1 Personal, Android Studio 2.1.2, Google Mobile Ads Unity Plugin v3.0.5 and on my console I get resolver version is 10102.
Upgrading Unity to 5.4.0f3 corrupted my project so that is not an option for now.
How can I debug this problem from here?