Moonwar
Moonwar

Reputation: 37

admob and unity / crash

Everything is fine in the console, but it crashes on the smartphone when the ad is requested.

InterstitialAd interstitial;

public void RequestInterstitial()
{
    string adUnitId = "from admob";
    interstitial = new InterstitialAd(adUnitId);
    AdRequest request = new AdRequest.Builder().Build();
    interstitial.LoadAd(request);
}

public void ShowInterstitial()
{
    if (interstitial.IsLoaded())
    {
        interstitial.Show();
    }
}

void Start() 
{
    string appId = "from admob";
    MobileAds.Initialize(appId);
}

Upvotes: 1

Views: 3340

Answers (1)

Moonwar
Moonwar

Reputation: 37

my problem solved this: Assets > Play Services Resolver > Android Resolver > Resolve Assets > Play Services Resolver > Android Resolver > Force Resolve

Upvotes: 2

Related Questions