Guye Incognito
Guye Incognito

Reputation: 2830

Admob 3.1.0 showing errors in Unity 5.4.1f1

I have Unity 5.4.1f1 I have the admob Unity sdk version 3.1.0

I setup an admob account, and then followed these steps

When I do a build for Android I get the following errors

enter image description here

When I play I get the following messages

enter image description here

Heres the full version of one of those errors

    WARNING: No compatible versions of com.android.support:support-v4 required by (com.android.support:appcompat-v7:23.1.0+, com.google.android.gms:play-services-basement:9.6.1), will try using the latest version 24.0.0
    UnityEngine.Debug:Log(Object)
    Google.JarResolver.PlayServicesSupport:Log(String, Boolean)
    Google.JarResolver.PlayServicesSupport:ResolveDependencies(Boolean)
    GooglePlayServices.ResolverVer1_1:DoResolutionNoAndroidPackageChecks(PlayServicesSupport, String, OverwriteConfirmation)
    GooglePlayServices.<DoResolution>c__AnonStorey1:<>m__0()
    GooglePlayServices.ResolverVer1_1:DoResolution(PlayServicesSupport, String, OverwriteConfirmation, Action)
    GooglePlayServices.PlayServicesResolver:Resolve(Action)
    GooglePlayServices.PlayServicesResolver:AutoResolve()
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Note that I already have Chartboost working.

I have so far been unable to display an admob ad in the editor or in a build with the following code.

    private void RequestAdmobInterstitial()
    {
        #if UNITY_ANDROID
        string adUnitId = "my ad unit id";
        #elif UNITY_IPHONE
            string adUnitId = "INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE";
        #else
            string adUnitId = "unexpected_platform";
        #endif

        // Initialize an InterstitialAd.
        InterstitialAd interstitial = new InterstitialAd(adUnitId);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(request);
    }

In a build nothing happens, in the editor I get these messages

enter image description here

Are these errors why it is it working? If so how do I fix them?

Upvotes: 0

Views: 1501

Answers (1)

turnipinrut
turnipinrut

Reputation: 614

This error:

WARNING: No compatible versions of com.android.support:support-v4

The script complaining about it is the google play jar resolver. It grabs all the necessary android libraries from your Android SDK location, and it can't find the libraries it wants.

This most likely means you are missing the android support libraries in your Android SDK folder.

To fix this, open up the Android SDK manager (most likely via Android Studio) and make sure you have the support libraries up to date.

While you're at it, update google play services too, cant hurt and might save you errors down the road.

Android Support Libraries

Upvotes: 1

Related Questions