Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Ads not working.

Discussion in 'Unity Ads' started by BKGamesStudio, Dec 20, 2016.

Thread Status:
Not open for further replies.
  1. BKGamesStudio

    BKGamesStudio

    Joined:
    Dec 9, 2016
    Posts:
    12
    I have this game that was using an opt-in advertising option, where the user could click a button, and it would display and add, then award them coins. In the editor it would redirect them to a scene that said "This would be your add unit." I decided after a long period of inactivity to give my game to a friend and have him run it with his organization. (He's new and just started with unity.) He succesfully linked the game with his organization, and both are under a new game ID. The problem is that advertizements never initiallize, and I never see the dummy ad when the button clicked. This is in unity 5.5.0f3. I know the code is correct because when it was linked with my organization it was working perfectly fine.
     
    Last edited: Dec 20, 2016
  2. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,177
    Have you selected Android or iOS as active build target in Build Settings window?

    /Rasmus
     
  3. BKGamesStudio

    BKGamesStudio

    Joined:
    Dec 9, 2016
    Posts:
    12
    Yes, Android is selected as my build target.
     
  4. Wylie-Modro

    Wylie-Modro

    Joined:
    Sep 2, 2016
    Posts:
    4
    A similar thing seems to have happened to me. I changed my product name in the PlayerSettings, and used the same name in the Unity Ads dashboard to create a project and it all seemed to work fine at least in the editor. Then I updated Unity to 5.5.0f3 and now none of the fake ads initialize.
     
  5. webspawn

    webspawn

    Joined:
    Aug 12, 2015
    Posts:
    2
    I have the same issue, Ad never initialize.
    Unity 5.5.0f3 (64bit)
     
  6. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,177
    Hi all,

    Please check device log for device. Look for "Initializing Unity Ads 2.0.x (200x) with game id <game id>", it should at least contain information either about campaign found or an error.

    /Rasmus
     
  7. BKGamesStudio

    BKGamesStudio

    Joined:
    Dec 9, 2016
    Posts:
    12
    So I figured out what is causing the issue, just not how to fix it. When a project is linked to an ad account and refreshing access fails (in the services window), if you try to link it as a new game or manually link it to the same one that failed it no longer recognizes that it is linked to an ad account.

    This is what appears when it successfully works, but when this issue occurs nothing appears in the console, and when ShowRewardedAd() is called it thinks the ad is never ready.

    upload_2017-1-1_19-37-2.png
    upload_2017-1-1_19-40-3.png
     
    kustom likes this.
  8. kustom

    kustom

    Joined:
    May 11, 2012
    Posts:
    80
    Hi guys,

    The same occurs to me. I am on Unity 5.5.0f3 and i always get Advertisement.IsReady() to false.
    I remember i changed then name of the project time ago ( and i never played with Ads in this project )
    I have created a new project now and link to my game and again i cant connect to Unity Ads.

    I will wait for any solution :/

    Cheers,
    Ruben
     
  9. UDN_2b28a598-f7b9-494a-81b5-6bd46e4c2b6a

    UDN_2b28a598-f7b9-494a-81b5-6bd46e4c2b6a

    Joined:
    Jan 2, 2017
    Posts:
    4
    Hi,

    Same here.
    I was working in my project and the ads were showing correctly in the editor and in the phone but suddenly they stopped working.
    I have tried different things to fix it but the ads still don't appear.

    I don't know what's happening.
    Any idea?

    Thanks.
     
  10. VictorCashDaShi

    VictorCashDaShi

    Joined:
    Nov 13, 2015
    Posts:
    30
    I had the same problem, I'd changed my game's name,when I test it localy it shows ads, but when i uploaded it to appstore, it stop showing ads, here is my post https://forum.unity3d.com/threads/unity-ads-not-showing-in-store-live-build.449457/

    The game is live and making ads revenue right now(not any more) Please help!
     
  11. UDN_2b28a598-f7b9-494a-81b5-6bd46e4c2b6a

    UDN_2b28a598-f7b9-494a-81b5-6bd46e4c2b6a

    Joined:
    Jan 2, 2017
    Posts:
    4
    I finally tried to export all my game into a new project and it worked.
     
    kustom likes this.
  12. abar

    abar

    Joined:
    Jan 12, 2014
    Posts:
    71
    I'm also getting this with 5.5.0f3.
    Advertisement.isInitialized always returns false, and GetPlacementState returns NotAvailable

    Any word on a proper solution?
     
  13. psavi

    psavi

    Joined:
    Jul 14, 2014
    Posts:
    2
    I'm getting this too...
     
  14. HappySaila

    HappySaila

    Joined:
    Dec 15, 2015
    Posts:
    2
    Okay. I fixed this after hours of fiddling.

    First:
    Do everything you were told to-do in the code samples.

    Second:
    Import the following ->
    using UnityEngine.Advertisements;
    using UnityEditor.Advertisements;
    using UnityEngine.Purchasing;

    Third (And probably the step you missed):
    Go to the unity ads services. (command.control - 0)
    Go advanced.
    Assign your game Id in unity services ad tab.
     
  15. h0p3y

    h0p3y

    Joined:
    Oct 29, 2012
    Posts:
    2
    i added the manual initialization method and my ads came back

    Advertisement.Initialize ("your-game-id-number-as-a-string");
     
    georgicanev95 likes this.
  16. zero_null

    zero_null

    Joined:
    Mar 11, 2014
    Posts:
    157
    hello, my ads are also not working. please help
     
  17. Omnicron45

    Omnicron45

    Joined:
    Sep 6, 2015
    Posts:
    1
    I had this exact problem where my ads wouldn't initialize automatically as usual and then even when I manually initialized them, Unity would never have an ad ready.
    After hours of trying, the only fix was for me to export my project, import it into a new project, and then link the new project to a whole new project in my Unity Services Account.
     
  18. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,177
    Please in those situations check device log for any relevant info/response from server. If you filter by "UnityAds", you should normally find some error message etc. Relinking project as described above, i.e. in practice using different game ids, could e.g. solve situation if you have reached the daily cap of ~25 ads per game/device.

    So check device log for device, if you cannot find relevant information, feel free to send it to support (see https://unityads.unity3d.com/help/help/contact).

    Thanks,
    Rasmus
     
  19. Jaysonmeribe

    Jaysonmeribe

    Joined:
    Mar 13, 2017
    Posts:
    7
    I have all the right and everything but my ad won't load and play here is my code I literally copied from the unity ads service code samples page in unity.
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.Advertisements;

    public class Ads : MonoBehaviour {

    public void ShowRewardedAd()
    {
    if (Advertisement.IsReady("rewardedVideo"))
    {
    var options = new ShowOptions { resultCallback = HandleShowResult };
    Advertisement.Show("rewardedVideo", options);
    }
    }

    private void HandleShowResult(ShowResult result)
    {
    switch (result)
    {
    case ShowResult.Finished:
    Debug.Log("The ad was successfully shown.");
    break;
    case ShowResult.Skipped:
    Debug.Log("The ad was skipped before reaching the end.");
    break;
    case ShowResult.Failed:
    Debug.LogError("The ad failed to be shown.");
    break;
    }
    }
    }
     
  20. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,177
    @Jaysonmeribe, do you get any error messages or can you describe what doesn't work? Which Unity version and platform (iOS/Android) are you using?

    /Rasmus
     
  21. Jaysonmeribe

    Jaysonmeribe

    Joined:
    Mar 13, 2017
    Posts:
    7
    I am using the newest version of unity, 5.6. and the ads just wont play there is not even a console message appearing.
    I have set my platform.
    Turned on unity ads.
    But everything I try I get the same result.

    I am using android
    I get absolutely nothing in the console
    And the ads don't a leave a trace.
     
  22. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,177
    Please verify that Ads is actually enabled. If you don't get any console message, even in editor, sounds like it's not enabled.

    /Rasmus
     
  23. wsuratt

    wsuratt

    Joined:
    Apr 8, 2017
    Posts:
    3
    Hi, I am having the same problem with the ads not working and no console message. I also double checked and I do have ads enabled in the services window and connected to my project.
     
  24. Jaysonmeribe

    Jaysonmeribe

    Joined:
    Mar 13, 2017
    Posts:
    7
    Its enabled I checked
     
  25. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,177
    Please verify that UnityAdsSetting in ProjectSetting/UnityConnectSettings.asset file contains following:

    Code (CSharp):
    1.   UnityAdsSettings:
    2.     m_Enabled: 1
    3.     m_InitializeOnStartup: 1
    4.     m_TestMode: 0
    5.     m_EnabledPlatforms: 4294967295
    6.     m_IosGameId: (your iOS game id)
    7.     m_AndroidGameId: (your Android game id)
    Especially let me know if m_EnabledPlatforms has different values than this.

    Thanks,
    Rasmus
     
    amoraleite, mochadwi20 and bloogames like this.
  26. wsuratt

    wsuratt

    Joined:
    Apr 8, 2017
    Posts:
    3
    When I click the UnityConnectSettings.asset file, it won't open.
     
  27. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,177
    You might have to change asset serialization for project to "Text Only" under Edit -> Project Settings -> Editor
     
    TheKingOfTheRoad and bloogames like this.
  28. wsuratt

    wsuratt

    Joined:
    Apr 8, 2017
    Posts:
    3
    Thank you, this fixed the error for me.
     
  29. Jaysonmeribe

    Jaysonmeribe

    Joined:
    Mar 13, 2017
    Posts:
    7
    How do you get to the UnityConnectSettings.asset file, I can't find it
     
  30. mochadwi20

    mochadwi20

    Joined:
    Dec 19, 2016
    Posts:
    9
    The answer is shown by rasmus-unity answer here.

     
  31. GeekCats

    GeekCats

    Joined:
    Jul 31, 2014
    Posts:
    58
    Same error here, on 5.3.2
    mine is m_EnabledPlatforms: 4294964991
    even if i change to 4294967295 still no ad

    on console:
    show Unity ads video on Win
    UnityEngine.Debug:Log(Object)
    InitScript:ShowVideo() (at Assets/***/Scripts/System/InitScript.cs:307)
    InitScript:ShowAdByType(AdType) (at Assets/***/Scripts/System/InitScript.cs:300)
    InitScript:CheckAdsEvents(GameState) (at Assets/***/Scripts/System/InitScript.cs:287)
    LevelManager:set_gameStatus(GameState) (at Assets/***/Scripts/LevelManager.cs:449)
    <PreWinAnimationsCor>c__Iterator3:MoveNext() (at Assets/***/Scripts/LevelManager.cs:1350)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
  32. Humanval

    Humanval

    Joined:
    May 24, 2016
    Posts:
    1
    my too : m_EnabledPlatforms: 4294964991 in 5.6.1.f1
     
  33. zero_null

    zero_null

    Joined:
    Mar 11, 2014
    Posts:
    157
    5.6.0p4 and my m_EnabledPlatforms: 4294967295
    still no signs of ads. Not even the dummy window in editor.
     
  34. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    69



    i can report that I did not have
    ...m_EnabledPlatforms ...
    in my UnityConnectSettings
     
  35. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,278
    i had same problem, if your android phone does not have google play service installed and running the ads will not initialize. most of phones bought in china are blocked against google play.
     
  36. Tiberius1701

    Tiberius1701

    Joined:
    Sep 16, 2014
    Posts:
    53
    I know this is a longshot, but I have a user (and his wife) who is using an Axon ZTE 7 phone and cannot view Unity Ads - every other device, iOS or Android works but this one - has anyone heard of anything specific to this phone that might block ads or otherwise interfere with Unity Ads?
     
  37. Callie-Zhu

    Callie-Zhu

    Unity Technologies

    Joined:
    Mar 2, 2016
    Posts:
    42
    Does his device have Google Play installed?
     
  38. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,177
    Thanks for reporting @Tiberius1701. Just checked, and unfortunately neither we internally or our cloud device partner have that particular device available. Is there any chance you could get access to device log for one of their devices?

    Run "adb logcat -v time UnityAds:V *:S" to get Ads relevant log messages.

    Thanks,
    Rasmus
     
  39. Tiberius1701

    Tiberius1701

    Joined:
    Sep 16, 2014
    Posts:
    53
    Hi Rasmus -

    Just checked and apparently ads have stopped working on all Android devices as of two weeks ago. Would a log from our Samsung Tab S help? Could this be related to switching from Closed Beta to Open Beta on Google Play?
     
  40. Tiberius1701

    Tiberius1701

    Joined:
    Sep 16, 2014
    Posts:
    53
    Btw, ads work fine on ios, and have for months. Both the ZTE Axons, our Samsung and Shield Tablets all have Google Play installed.
     
  41. Tiberius1701

    Tiberius1701

    Joined:
    Sep 16, 2014
    Posts:
    53
    In looking at my logs, it appears I now have a problem with authentication. Any suggestions as to what to look at (not sure why this changed in the past two weeks).
     
  42. Tiberius1701

    Tiberius1701

    Joined:
    Sep 16, 2014
    Posts:
    53
    I have fixed the sign in error, but the Ads still do not play - I get this red error in the console:

    03-23 13:55:09.218: E/Unity(14429): Initializing Unity Ads.

    03-23 13:55:09.218: E/Unity(14429):

    03-23 13:55:09.218: E/Unity(14429): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

    03-23 13:55:09.233: E/Unity(14429): AndroidJavaException: java.lang.ClassNotFoundException: com.unity3d.ads.purchasing.IPurchasing

    03-23 13:55:09.233: E/Unity(14429): java.lang.ClassNotFoundException: com.unity3d.ads.purchasing.IPurchasing

    03-23 13:55:09.233: E/Unity(14429): at java.lang.Class.classForName(Native Method)

    03-23 13:55:09.233: E/Unity(14429): at java.lang.Class.forName(Class.java:324)

    03-23 13:55:09.233: E/Unity(14429): at java.lang.Class.forName(Class.java:285)

    03-23 13:55:09.233: E/Unity(14429): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)

    03-23 13:55:09.233: E/Unity(14429): at com.unity3d.player.UnityPlayer.c(Unknown Source)

    03-23 13:55:09.233: E/Unity(14429): at com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source)

    03-23 13:55:09.233: E/Unity(14429): at android.os.Handler.dispatchMessage(Handler.java:98)

    03-23 13:55:09.233: E/Unity(14429): at android.os.Looper.loop(Looper.java:148)

    03-23 13:55:09.233: E/Unity(14429): at com.unity3d.player.UnityPlayer$c.run(Unknown Source)

    03-23 13:55:09.233: E/Unity(14429): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.unity3d.ads.purchasing.IPurchasing" on path: DexPathList[[zip file "/data/app/com.EscapeHatchEntertainment.Weaponaire-1/base.apk"],nativeLibraryDirectories=[/data/app/com.EscapeHatchEntertainment.Weaponaire-1/lib/arm, /data/app/com.EscapeHatchEntertainment.Weaponaire-1/base.apk!/lib/armeabi-v7a, /vendor/lib,
     
  43. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,177
    Looks like IAP is failing? Are you also integrating IAP in your game?

    /Rasmus
     
  44. Tiberius1701

    Tiberius1701

    Joined:
    Sep 16, 2014
    Posts:
    53
    Yes, and just downloaded the newest version two weeks ago. Could the iAP issue be somehow breaking the ads?
     
  45. Tiberius1701

    Tiberius1701

    Joined:
    Sep 16, 2014
    Posts:
    53
    I think I might have fixed this one - downloaded and imported the latest Unity Ads, turned off ads service and they started working again!
     
    Callie-Zhu and rasmus-unity like this.
  46. Doombeatz

    Doombeatz

    Joined:
    Jul 16, 2015
    Posts:
    3
    Hello @all,
    I got stucked on the same error. Then I've noticed that when unity ads is activated via the editor services tab, it tries to initialize automatically even if there is no internet connection and that error freeze the app.
    Like @Tiberius did, I turned off the editor toogle, and finaly imported the latest Unity ADS package. By that way i'm sure to be the one who initialize when I want. Then everything was fine.
    Hope it will help someone.
     
  47. TheKingOfTheRoad

    TheKingOfTheRoad

    Joined:
    Apr 24, 2013
    Posts:
    205
    Hi. I solved everything Unity Ads related just fixing Project Settings using a Fresh Project as a base.
     
    Last edited: Jun 6, 2018
  48. JelmerV

    JelmerV

    Joined:
    Nov 29, 2012
    Posts:
    180
    Can't get it to work in 2018.1: first i tried with the built in package (purple/green test-ad shows in editor). But on iOS nothing happens and it hangs on my coroutine.
    Then I switched off the built in package (services>ads>advanced) and imported from the asset store. Same result.
    In Unity ads I have the iOS app from the app store listed and made sure rewardedVideo is there and active.

    There is IAP in the project..

    Code (CSharp):
    1. public void WatchVideoAd(){
    2.         StartCoroutine(ShowAdWhenReady());
    3.     }
    4.  
    5.     IEnumerator ShowAdWhenReady()
    6.     {
    7.         spinner.SetActive(true);
    8.         while (!Advertisement.IsReady("rewardedVideo"))
    9.             yield return null;
    10.  
    11.         spinner.SetActive(false);
    12.         ShowOptions options = new ShowOptions();
    13.         options.resultCallback = HandleAdResult;
    14.  
    15.         Advertisement.Show("rewardedVideo", options);
    16.     }
    17.  
    18.     private void HandleAdResult(ShowResult result)
    19.     {
    20.         switch (result)
    21.         {
    22.             case ShowResult.Finished:
    23.                 Debug.Log("The ad was successfully shown.");
    24.                 purchaseCanvas.GetComponent<Canvas>().enabled = false;
    25.                 GameObject.Find("AirplaneManager").GetComponent<AirplaneManager>().SelectPlane(1);
    26.  
    27.                 break;
    28.             case ShowResult.Skipped:
    29.                 Debug.Log("The ad was skipped before reaching the end.");
    30.              
    31.                 break;
    32.             case ShowResult.Failed:
    33.                 Debug.LogError("The ad failed to be shown.");
    34.              
    35.                 break;
    36.         }
    37.     }
     
  49. gravitygames288

    gravitygames288

    Joined:
    Jul 15, 2018
    Posts:
    2
    Hi guys. How's it going? After apply SDK 3.0, can not display ads, except Editor
     
  50. SnaiperoG

    SnaiperoG

    Joined:
    Apr 6, 2015
    Posts:
    8
    same
     
Thread Status:
Not open for further replies.