Search Unity

Unity Ads Not Showing In Nexus 5 Android 6.0.1

Discussion in 'Unity Ads & User Acquisition' started by tonyjoseph456, Dec 28, 2016.

  1. tonyjoseph456

    tonyjoseph456

    Joined:
    Oct 24, 2014
    Posts:
    17
    I have implemented Unity Ads in my game and its showing test ads perfectly fine in many devices such as Xiaomi Mi 4 LTE(Android 6.0.1), Galaxy S2 (4.1.2) and Xiaomi Redmi 2 Prime (Android 5.1.1), Xiaomi Mi Pad 2 (Android 5.1) etc. But its not showing Ads in Nexus 5 (Android 6.0.1). The Unity Version I'm using is Unity 5.3.4f1.
    Here is the code that I have used in my game:

    Code (CSharp):
    1. public void ShowRewardedAd()
    2.     {
    3.         Debug.Log("Rewarded Ad 1 "+Advertisement.IsReady("rewardedVideo"));
    4.         if (Advertisement.IsReady("rewardedVideo"))
    5.         {
    6.             Debug.Log("Rewarded Ad");
    7.             var options = new ShowOptions { resultCallback = HandleShowResult };
    8.             Advertisement.Show("rewardedVideo", options);
    9.          
    10.         }
    11.     }
    12.  
    13.     private void HandleShowResult(ShowResult result)
    14.     {
    15.         switch (result)
    16.         {
    17.             case ShowResult.Finished:
    18.                Debug.Log("The ad was successfully shown.");
    19.                 break;
    20.             case ShowResult.Skipped:
    21.                 Debug.Log("The ad was skipped before reaching the end.");
    22.                 break;
    23.             case ShowResult.Failed:
    24.                 Debug.LogError("The ad failed to be shown.");
    25.                 break;
    26.         }
    27.     }
    28.     public void showInterstitialAd()
    29.     {
    30.         Debug.Log("Called Unity Ad Function "+Advertisement.IsReady());
    31.         if (Advertisement.IsReady())
    32.         {
    33.             Advertisement.Show();
    34.         }
    35.     }
    In Nexus 5, Advertisement.IsReady() is always giving false. So Advertisement is not showing in Nexus 5, where as in other tested devices mentioned above, it is always giving true for the same app apk. All the devices are connected to the same WiFI network. Still Ad is not loading in Nexus 5. I have checked the logcat and can't find any particular error for the Unity Ads when running in Nexus 5. Can someone please help me in this issue. Is this any bug in the UnityAds?
     
    Last edited: Dec 28, 2016
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Would expect device log (logcat) to have the relevant information. Can you post that?

    /Rasmus
     
  3. tonyjoseph456

    tonyjoseph456

    Joined:
    Oct 24, 2014
    Posts:
    17
    Here is the Logcat log from Nexus 5.

    12-28 13:07:03.694: I/Unity(11436): Called Unity Ad Function False.

    Note that this is the line where Advertisement.IsReady() is giving false in Nexus 5.
     
  4. tonyjoseph456

    tonyjoseph456

    Joined:
    Oct 24, 2014
    Posts:
    17
    Hi, I have posted the logcat log from the Nexus 5, after playing my game. Can you please check it.
     
  5. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Correct, not much useful information in that one.

    I'm looking for something like following info in log:
    You can filter Unity Ads relevant log message by using
    /Rasmus
     
  6. tonyjoseph456

    tonyjoseph456

    Joined:
    Oct 24, 2014
    Posts:
    17
    I'm using the automatic initialization of unity ads. So no separate initialization code is given in my game.
     
  7. tonyjoseph456

    tonyjoseph456

    Joined:
    Oct 24, 2014
    Posts:
    17
    Its mentioned in this link that, http://unityads.unity3d.com/help/monetization/integration-guide-unity#using-the-services-window
    . I have enabled Ads through the Services Window. So is it because of that, these logs given below are not showing in my game log in logcat?

     
  8. tonyjoseph456

    tonyjoseph456

    Joined:
    Oct 24, 2014
    Posts:
    17
    I have also reported this issue via Unity and the link is given below. Hope it will be helpful for solving this issue.
    https://fogbugz.unity3d.com/default.asp?865363
     
  9. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Thanks, I'll take a look at the reported bug. However the posted log entries above was also from a project using engine Ads SDK integration.

    And for future, when posting links to Fogbugz tickets, *don't* include the part after the underscore, as this is an authentication token which gives anyone with that link access to e.g. files on the bug report. Perhaps we need to make this more clear than just "Note that sharing it will also share all your other cases and email conversations in them." in the automated mail :)

    /Rasmus
     
  10. tonyjoseph456

    tonyjoseph456

    Joined:
    Oct 24, 2014
    Posts:
    17
    Oops. Sorry. I didn't think that it was an authentication token. I didn't have experience in sharing the Fogbugz tickets. So that's why it happened. Thanks for reminding me the consequences of it. Thanks for editing my reply too.. Can you please check about this issue, as my game needs to be published soon.

    Thanks.
     
  11. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Sorry, couldn't find any relevant information in that Fogbugz ticket.

    Could you please try to run
    And verify that the log contains the "Initializing Unity Ads (...)" part. Alternatively somehow give us access to your project or apk file, so we can test here.

    Thanks,
    Rasmus
     
  12. tonyjoseph456

    tonyjoseph456

    Joined:
    Oct 24, 2014
    Posts:
    17
    Hi,

    I have uploaded the project to Google Drive and here is the link of it.
    https://goo.gl/akvQAz

    Can you please check it..

    Its a test project created for demonstration. In that, in Nexus 5, the following screen is shown:


    where as in other devices, this is shown.


    Please note, that I have waited for more than 1 hour, still Ad is not ready in Nexus 5. where as in other devices, it usually takes less than 30 seconds to show that Ad is ready. So its not the issue of internet also. I hope this will help you.

    Thanks
     
    Last edited: Dec 28, 2016
  13. tonyjoseph456

    tonyjoseph456

    Joined:
    Oct 24, 2014
    Posts:
    17
    Also I got an error in the logcat like this:
    This error was not seen in the original project.
     
  14. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Thanks for the updated logfile. In any case, since you are using older version of SDK ("sdkVersion=1506" = 1.5), I would recommend that you upgrade to SDK 2.0, in one of following ways:

    - Update project to use Unity 5.5.0, which has Unity Ads SDK 2.0 integrated
    - or integrate Ads SDK 2.0 from asset store: https://www.assetstore.unity3d.com/en/#!/content/66123

    Please let us know if upgrading to latest Unity/SDK version solves the issue.

    /Rasmus
     
  15. tonycsharks

    tonycsharks

    Joined:
    Dec 31, 2015
    Posts:
    27
    Thanks. It worked. I had integrated Unity Ads SDK 2.0 to my project having Unity 5.3.4 and Ads are now showing fine in Nexus 5. Thanks again for the help... :)
     
    rasmus-unity likes this.
  16. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Good. Thanks for the feedback.

    /Rasmus
     
  17. Mazyod

    Mazyod

    Joined:
    Apr 21, 2014
    Posts:
    25
    Thanks guys, was running into this issue today, and this saved me a lot of headache. I wish I can upgrade to 5.5, but still waiting on the 5.5.1 release to ensure some stability before publishing our game.
     
  18. Mazyod

    Mazyod

    Joined:
    Apr 21, 2014
    Posts:
    25
    After updating the project with the asset store package, it seems that that UNITY_ADS define is no longer available? What is the best approach to check if the current platform supports ads?

    (NOTE: I'm using NGUI in my project, and it seems that NGUI overrides the project's platform dependent defines and assigns the define NGUI there. Perhaps it is causing issues..?)
     
  19. Mazyod

    Mazyod

    Joined:
    Apr 21, 2014
    Posts:
    25
  20. tonycsharks

    tonycsharks

    Joined:
    Dec 31, 2015
    Posts:
    27
    Is there any issue with the Unity Ads server? Today I'm not getting any test ads on my all devices. Ads are shown only once or twice when tested several times in many devices..
     
  21. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    @tonycsharks: correct, we have an issue with ads delivery right now. being investigated.

    /Rasmus
     
  22. tonycsharks

    tonycsharks

    Joined:
    Dec 31, 2015
    Posts:
    27
    Thanks for confirming it. I thought it was an issue with the unity ads in our devices.