Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

AdMob problem with interstitial ads and Unity 5.3.3

Discussion in 'Android' started by mdrotar, Mar 10, 2016.

  1. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    W/Ads﹕ Timed out waiting for WebView to finish loading.

    Has anyone else seen this error with the official AdMob plugin for Unity? Googling doesn't seem to bring up anything useful. I'm using Unity 5.3.3p1. 5.3.3p2 doesn't look like it has any pertinent bug fixes.

    The first interstitial Ad loads and displays fine. And if I load another ad soon after and display it, it displays fine. The error occurs only if I let the device sleep for a while (about an hour?). Then the next time I try to load an ad nothing happens except this error showing up in logcat about 30 seconds later. The AdFailedToLoad event does not even trigger in Unity. It will do this every time I try to load an ad until the application is restarted.

    The ads work fine in Unity 5.2.4. Unfortunately, I can't just revert back to 5.2.4 because it has other issues.
     
  2. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    Confirmed the same problem using AdMob's example code. Using a Nexus 7 (2012), problem occurs with 5.3.3p1 but not with 5.2.4f1 so something changed with Unity somewhere in 5.3.X.
     
  3. mubashar437

    mubashar437

    Joined:
    Sep 29, 2014
    Posts:
    28
  4. Aseemy

    Aseemy

    Joined:
    Aug 22, 2015
    Posts:
    203
    Right now my apps are not even showing a single ad, banner or interstitial. existing apps on play store have stopped showing ads. Always no FIll. Tried test ads on blank project, still No fill. admob working on my non unity apps though. Must be a problem on their side with unity.
     
  5. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    I did try the older version 2.3.1 but it has the same result. I suppose it could be a bug in admob but it's weird that I don't have a problem using it in Unity 5.2.4.
     
  6. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    That sounds like a different problem.
     
  7. mubashar437

    mubashar437

    Joined:
    Sep 29, 2014
    Posts:
    28
    I think this gotta to do with how you downloaded/installed unity 5.3. If this was an issue with unity there must have been a bug report by now. I am on 5.2.4 so cann't say for sure.

    Furthermore, make an empty project with nothing but admob in it. see what happens.
     
  8. Aseemy

    Aseemy

    Joined:
    Aug 22, 2015
    Posts:
    203
    I understand i am having a different issue than OP but wanted to let him know that unity and admob are having an issue right now. Can anyone confirm that their apps are showing admob ads or even ad mob test ads?
     
  9. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    I don't think so. It's easy to miss because it does work for a while. I'm sure most developers testing their own game are restarting the game often, and the non-developer testers might not notice if they don't see an ad (it's a "feature"). Someone might assume the ad just wasn't filled. And I'm not sure where along 5.3.X it was introduced. It could be recent.

    That's what I did when I confirmed the problem occurs even with admob's sample program.

    I can confirm admob ads work (test ads and live ads) in both 5.2.4 and 5.3.3p1... it's just they stop working after the game has been running sleeping for a while in 5.3.3p1...
     
    Last edited: Mar 15, 2016
  10. Aseemy

    Aseemy

    Joined:
    Aug 22, 2015
    Posts:
    203
    5.3.4 is out, maybe that'll fix your issue
     
  11. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    As expected, 5.3.4 does not fix it.

    But a little more information:
    The Nexus 7 (2012) which I used to produce this error is running Android 4.3.
    I also tested on a Nexus 4 running Android 5.1 and can't seem to reproduce the error on it.
     
  12. Marik_2015

    Marik_2015

    Joined:
    Oct 30, 2015
    Posts:
    4
    https://18220747100232649887.google...BRvHflitokZMslc6Pd07_m61QSIDE8cjbabbt4r-qyVYwI want to connect admob interstitial ads. I use Google Mobile Ads Unity Plugin v3.0.5.
    From this link: https://github.com/googleads/googleads-mobile-unity/releases/tag/3.0.5

    Everything is connected, but does not display advertising. Here is the error that provides:

    Dummy .ctor
    UnityEngine.Debug:Log(Object)
    GoogleMobileAds.Common.DummyClient:.ctor()
    (at Assets/GoogleMobileAds/Common/DummyClient.cs:47)
    GoogleMobileAds.GoogleMobileAdsClientFactory:BuildInterstitialClient()
    (at Assets/GoogleMobileAds/Platforms/GoogleMobileAdsClientFactory.cs:45)
    GoogleMobileAds.Api.InterstitialAd:.ctor(String)



    Dummy LoadAd
    UnityEngine.Debug:Log(Object)
    GoogleMobileAds.Common.DummyClient:LoadAd(AdRequest)
    (at Assets/GoogleMobileAds/Common/DummyClient.cs:57)
    GoogleMobileAds.Api.InterstitialAd:LoadAd(AdRequest)
    (at Assets/GoogleMobileAds/Api/InterstitialAd.cs:66)
     
  13. Aseemy

    Aseemy

    Joined:
    Aug 22, 2015
    Posts:
    203

    This is the dummy message provided by the plugin when running in the editor. You need to run your app on an emulator or a physical device to see ads.
     
  14. Marik_2015

    Marik_2015

    Joined:
    Oct 30, 2015
    Posts:
    4
    Thank you, but on the emulator or devayse too, there's nothing
     
  15. Aseemy

    Aseemy

    Joined:
    Aug 22, 2015
    Posts:
    203
    Please create your own thread and post your code related to ads, i will gladly help you.
     
  16. Marik_2015

    Marik_2015

    Joined:
    Oct 30, 2015
    Posts:
    4
    Thank you, interstitial advertising already there !!! And the device works !!!
    Now I have a task, add a video for advertising
    reward !!! Here is my code:

    using System.Collections;

    using UnityEngine.SceneManagement;


    using GoogleMobileAds;
    using GoogleMobileAds.Api;





    public class nex_9_Video : MonoBehaviour {


    private RewardBasedVideoAd rewardBasedVideo;

    public int unlocklevel = 10;
    public static int Level = 10;


    public GameObject Next_lev_Video,Videorekl;



    void Start () {

    rewardBasedVideo_OnAdRewarded += HandleRewardBasedVideoRewarded;

    #if UNITY_ANDROID
    string adUnitId = "ca-app-pub-1429438471709960/3441074930";
    #elif (UNITY_5 && UNITY_IOS) || UNITY_IPHONE
    string adUnitId = "INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE";
    #else
    string adUnitId = "unexpected_platform";
    #endif

    rewardBasedVideo.LoadAd(createAdRequest(), adUnitId);

    // Register for ad events.
    AdRequest request = new AdRequest.Builder().Build();



    }
    private void RequestRewardBasedVideo()
    {

    #if UNITY_ANDROID
    string adUnitId = "ca-app-pub-1429438471709960/3441074930";
    #elif (UNITY_5 && UNITY_IOS) || UNITY_IPHONE
    string adUnitId = "INSERT_IOS_REWARD_BASED_VIDEO_AD_UNIT_ID_HERE";
    #else
    string adUnitId = "unexpected_platform";
    #endif

    rewardBasedVideo.LoadAd(createAdRequest(), adUnitId);
    }


    private AdRequest createAdRequest()
    {
    return new AdRequest.Builder()

    .Build();
    }

    void Update () {


    }

    void OnMouseDown()
    {

    if (rewardBasedVideo.IsLoaded())
    {
    rewardBasedVideo.Show();
    }


    }

    public void HandleRewardBasedVideoRewarded(object sender, Reward args)
    {

    Next_lev_Video.SetActive (true);
    Videorekl.SetActive (false);

    }




    }
     
  17. google_play_service_dev

    google_play_service_dev

    Joined:
    Oct 2, 2016
    Posts:
    16
    Have you try https://github.com/unity-plugins/google-play-game-service-unity-plugin
     
  18. Adishah11

    Adishah11

    Joined:
    Aug 10, 2015
    Posts:
    9