Unity ads shows only at first launch of the game

Android game show ads only first time after instalation, or first time after reset the phone (turn off and on). When I play next time ads are not loading. I suspect it has something common with this pop-up window about cookie policy, if it doesn’t show, ads doesn’t show either. Problem occurs also on new empty project, tested on galaxy s4 and galaxy s8. I tried in test mode and with real ads, all the same, it’s loading only at first launch of the application, when it asks about cookie permission. I’m quite sure it’s nothing wrong with my code, as it comes from documentation Game is not integrated with Google Play.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Monetization;
using UnityEngine.UI;

public class AdController : MonoBehaviour
{
    string log;
    public GameObject Log;

    public static AdController Instance { get; private set; }

    public bool isInTestMode = false;

    private string GooglePlayID = "*******";

    private string videoAd = "video";
    private string rewardedVideoAd = "rewardedVideo";

    private void Awake()
    {

        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

    }
    // Start is called before the first frame update
    void Start()
    {
        if (!Monetization.isInitialized)
        {
            Monetization.Initialize(GooglePlayID, isInTestMode);

        }

        if(Monetization.isInitialized)
        {
            PrintLog("Monetization is initialized");
        }
        else
        {
            PrintLog("Monetization is not initialized");
        }
    }

    public void ShowAd()
    {

        if (!Monetization.isInitialized)
        {
            Monetization.Initialize(GooglePlayID, isInTestMode);
        }
        if (Monetization.isInitialized)
        {
            PrintLog("Monetization is initialized");
        }
        else
        {
            PrintLog("Monetization is not initialized");
        }
        StartCoroutine(WaitForAd(false));
    }

    public void ShowRewardedAd()
    {
        if (!Monetization.isInitialized)
        {
            Monetization.Initialize(GooglePlayID, isInTestMode);
        }
        if (Monetization.isInitialized)
        {
            PrintLog("Monetization is initialized");
        }
        else
        {
            PrintLog("Monetization is not initialized");
        }
        StartCoroutine(WaitForAd(true));
    }
    IEnumerator WaitForAd(bool rewarded = false)
    {
        PrintLog("Waiting for ad");
        string placementId = rewarded ? rewardedVideoAd : videoAd;

        while (!Monetization.IsReady(placementId))
        {
            yield return null;
        }

        ShowAdPlacementContent ad = null;
        ad = Monetization.GetPlacementContent(placementId) as ShowAdPlacementContent;

        if (ad!=null)
        {
            PrintLog("Ad is loaded");
        }
        else
        {
            PrintLog("Ad is not loaded");
        }

        if (ad != null)
        {
            if (rewarded)
                ad.Show(AdFinished);
            else
                ad.Show();
        }
    }
    void AdFinished(ShowResult result)
    {
        if (result == ShowResult.Finished)
        {
            //Reward player
            PrintLog("Result: " + result.ToString());
        }
    }

    void PrintLog(string txt)
    {
        log = log + txt + "     ";
        Log.GetComponent<Text>().text = log;

    }
}

Can you provide device logs?

Ok I had to learn how to use adb, but Finally I have the log :slight_smile:

--------- beginning of system
--------- beginning of main
I/Unity   (27860): onResume
D/Unity   (27860): SetWindow 0 0x92743608
D/Unity   (27860): SetWindow 0 0x92743608
I/Unity   (27860): windowFocusChanged: true
D/Unity   (27860): Unity systrace disabled: failed to load native tracing API
D/Unity   (27860): [VFS] Mount /mnt/asec/com.MyCompany.AdsTest-1/base.apk
I/Unity   (27860): SystemInfo CPU = ARMv7 VFPv3 NEON, Cores = 4, Memory = 1819mb
I/Unity   (27860): SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf), 0 little (mask: 0x0)
I/Unity   (27860): ApplicationInfo com.MyCompany.AdsTest version 0.1 build a512174b-4ec7-4103-bcd1-031045065179
I/Unity   (27860): Built from '2019.1/staging' branch, Version '2019.1.1f1 (fef62e97e63b)', Build type 'Development', Scripting Backend 'il2cpp', CPU 'armeabi-v7a', Stripping 'Enabled'
D/Unity   (27860): PlayerConnection initialized from /mnt/asec/com.MyCompany.AdsTest-1/base.apk/assets/bin/Data (debug = 0)
E/Unity   (27860): Socket: set reusable port failed, error: Protocol not available(92)
E/Unity   (27860):
E/Unity   (27860): (Filename: ./Runtime/Network/Sockets.cpp Line: 415)
E/Unity   (27860):
E/Unity   (27860): Socket: set reusable port failed, error: Protocol not available(92)
E/Unity   (27860):
E/Unity   (27860): (Filename: ./Runtime/Network/Sockets.cpp Line: 415)
E/Unity   (27860):
E/Unity   (27860): Socket: set reusable port failed, error: Protocol not available(92)
E/Unity   (27860):
E/Unity   (27860): (Filename: ./Runtime/Network/Sockets.cpp Line: 415)
E/Unity   (27860):
E/Unity   (27860): Socket: set reusable port failed, error: Protocol not available(92)
E/Unity   (27860):
E/Unity   (27860): (Filename: ./Runtime/Network/Sockets.cpp Line: 415)
E/Unity   (27860):
D/Unity   (27860): PlayerConnection initialized network socket : 0.0.0.0 55397
D/Unity   (27860): PlayerConnection initialized unix socket : Unity-com.MyCompany.AdsTest
D/Unity   (27860): Multi-casting "[IP] 192.168.1.34 [Port] 55397 [Flags] 3 [Guid] 2738031774 [EditorId] 1721574797 [Version] 1048832 [Id] AndroidPlayer(samsung_GT-I9505@192.168.1.34) [Debug] 1 [PackageName] AndroidPlayer" to [225.0.0.222:54997]...
D/Unity   (27860): Waiting for connection from host on [0.0.0.0:55397]...
D/Unity   (27860): PlayerConnection accepted from [192.168.1.33] handle:0x2c
D/Unity   (27860): Started listening to [0.0.0.0:55397]
D/Unity   (27860): [EGL] Attaching window :0x92743608
D/Unity   (27860): InitializeScriptEngine OK (0xa08e5fe0)
D/Unity   (27860): PlayerConnection already initialized - listening to [0.0.0.0:55397]
D/Unity   (27860): PlayerInitEngineNoGraphics OK
D/Unity   (27860): AndroidGraphics::Startup window =  0x92743608
D/Unity   (27860): [EGL] Attaching window :0x92743608
D/Unity   (27860): Vulkan detection: 0
D/Unity   (27860): [EGL] Request: ES 3.1+AEP RGB0 000 0/0
D/Unity   (27860): [EGL] Checking ES 3.1 support...
D/Unity   (27860): [EGL] ES3.1 not supported
D/Unity   (27860): [EGL] Request: ES 3.1 RGB0 000 0/0
D/Unity   (27860): [EGL] Request: ES 3.0 RGB0 000 0/0
D/Unity   (27860): [EGL] Found: ID[1] ES 3.0 RGB16 565 0/0
D/Unity   (27860): GfxDevice: creating device client; threaded=1
D/Unity   (27860): [EGL] Request: ES 3.1+AEP RGB0 000 0/0
D/Unity   (27860): [EGL] Request: ES 3.1 RGB0 000 0/0
D/Unity   (27860): [EGL] Request: ES 3.0 RGB0 000 0/0
D/Unity   (27860): [EGL] Found: ID[1] ES 3.0 RGB16 565 0/0
D/Unity   (27860): [EGL] Request: ES 3.0 RGBA32 8888 0/0
D/Unity   (27860): [EGL] Found: ID[5] ES 3.0 RGBA32 8888 0/0
D/Unity   (27860): extension is supported with value 0
D/Unity   (27860): ANativeWindow: (1080/1920) RequestedResolution: (0/0) RenderingResolution: (0/0) EGLSurface: (1080/1920)
D/Unity   (27860): Renderer: Adreno (TM) 320
D/Unity   (27860): Vendor:   Qualcomm
D/Unity   (27860): Version:  OpenGL ES 3.0 V@84.0 AU@  (CL@)
D/Unity   (27860): GLES:     3
D/Unity   (27860):  GL_EXT_disjoint_timer_query
D/Unity   (27860): OPENGL LOG: Creating OpenGL ES 3.0 graphics device ; Context level  <OpenGL ES 3.0> ; Context handle -1969934400
D/Unity   (27860): [EGL] Attaching window :0x92743608
D/Unity   (27860): Requested framebuffer: resolution[1080x1920], rgba[8/8/8/8], depth+stencil[on], samples[1]
D/Unity   (27860): Created framebuffer: resolution[1080x1920], rgba[8/8/8/8], depth+stencil[24/8], samples[0]
D/Unity   (27860): [EGL] Attaching window :0x92743608
D/Unity   (27860): Initialize engine version: 2019.1.1f1 (fef62e97e63b)
D/Unity   (27860): PlayerInitEngineGraphics OK
D/Unity   (27860): Found 18 native sensors
D/Unity   (27860): Sensor :        Accelerometer ( 1) ; 0.000599 / 0.01s ; K330 3-axis Accelerometer / STMicroelectronics
D/Unity   (27860): Sensor :        Accelerometer ( 1) ; 0.000599 / 0.01s ; K330 3-axis Accelerometer / STMicroelectronics
D/Unity   (27860): UnloadTime: 0.488281 ms
D/Unity   (27860): UUID: aab26881f99a2a9f => 81faee63918747dccb54d006cbe036f5
D/Unity   (27860): Sensor :        Accelerometer ( 1) ; 0.000599 / 0.01s ; K330 3-axis Accelerometer / STMicroelectronics
D/Unity   (27860): Choreographer available: Enabling VSYNC timing
I/Unity   (27860): windowFocusChanged: false
I/Unity   (27860): onPause
D/Unity   (27860): Setting up 1 worker threads for Enlighten.
D/Unity   (27860):   Thread -> id: ffffffff99a58e00 -> priority: 1
D/Unity   (27860): ASensorManager_destroyEventQueue returned 0
I/Unity   (27860): ##utp:{"type":"MemoryLeaks","version":2,"phase":"Immediate","time":1558014611589,"processId":27860,"allocatedMemory":148672,"memoryLabels":[{"Default":56},{"NewDelete":13760},{"Thread":4294967248},{"Manager":192},{"GfxDevice":4628},{"Audio":88},{"Serialization":24},{"Terrain":60},{"String":2604},{"DynamicArray":123976},{"Utility":1680},{"PoolAlloc":4294967236},{"ScriptManager":1416},{"VR":20},{"SceneManager":224},{"EditorGui":52}]}
I/Unity   (27860): onDestroy
I/Unity   (27860): onResume
D/Unity   (27860): SetWindow 0 0x92744408
D/Unity   (27860): SetWindow 0 0x92744408
I/Unity   (27860): windowFocusChanged: true
D/Unity   (27860): Unity systrace disabled: failed to load native tracing API
D/Unity   (27860): [VFS] Mount /mnt/asec/com.MyCompany.AdsTest-1/base.apk
I/Unity   (27860): SystemInfo CPU = ARMv7 VFPv3 NEON, Cores = 4, Memory = 1819mb
I/Unity   (27860): SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf), 0 little (mask: 0x0)
I/Unity   (27860): ApplicationInfo com.MyCompany.AdsTest version 0.1 build a512174b-4ec7-4103-bcd1-031045065179
I/Unity   (27860): Built from '2019.1/staging' branch, Version '2019.1.1f1 (fef62e97e63b)', Build type 'Development', Scripting Backend 'il2cpp', CPU 'armeabi-v7a', Stripping 'Enabled'
D/Unity   (27860): PlayerConnection initialized from /mnt/asec/com.MyCompany.AdsTest-1/base.apk/assets/bin/Data (debug = 0)
E/Unity   (27860): Socket: set reusable port failed, error: Protocol not available(92)
E/Unity   (27860):
E/Unity   (27860): (Filename: ./Runtime/Network/Sockets.cpp Line: 415)
E/Unity   (27860):
E/Unity   (27860): Socket: set reusable port failed, error: Protocol not available(92)
E/Unity   (27860):
E/Unity   (27860): (Filename: ./Runtime/Network/Sockets.cpp Line: 415)
E/Unity   (27860):
E/Unity   (27860): Socket: set reusable port failed, error: Protocol not available(92)
E/Unity   (27860):
E/Unity   (27860): (Filename: ./Runtime/Network/Sockets.cpp Line: 415)
E/Unity   (27860):
E/Unity   (27860): Socket: set reusable port failed, error: Protocol not available(92)
E/Unity   (27860):
E/Unity   (27860): (Filename: ./Runtime/Network/Sockets.cpp Line: 415)
E/Unity   (27860):
D/Unity   (27860): PlayerConnection initialized network socket : 0.0.0.0 55029
D/Unity   (27860): PlayerConnection initialized unix socket : Unity-com.MyCompany.AdsTest
D/Unity   (27860): Multi-casting "[IP] 192.168.1.34 [Port] 55029 [Flags] 3 [Guid] 2351345499 [EditorId] 1721574797 [Version] 1048832 [Id] AndroidPlayer(samsung_GT-I9505@192.168.1.34) [Debug] 1 [PackageName] AndroidPlayer" to [225.0.0.222:54997]...
D/Unity   (27860): Waiting for connection from host on [0.0.0.0:55029]...
D/Unity   (27860): PlayerConnection accepted from [192.168.1.33] handle:0x2c
D/Unity   (27860): Started listening to [0.0.0.0:55029]
D/Unity   (27860): [EGL] Attaching window :0x92744408
D/Unity   (27860): InitializeScriptEngine OK (0x9f75bfe0)
D/Unity   (27860): PlayerConnection already initialized - listening to [0.0.0.0:55029]
D/Unity   (27860): PlayerInitEngineNoGraphics OK
D/Unity   (27860): AndroidGraphics::Startup window =  0x92744408
D/Unity   (27860): [EGL] Attaching window :0x92744408
D/Unity   (27860): Vulkan detection: 0
D/Unity   (27860): [EGL] Request: ES 3.1+AEP RGB0 000 0/0
D/Unity   (27860): [EGL] Checking ES 3.1 support...
D/Unity   (27860): [EGL] ES3.1 not supported
D/Unity   (27860): [EGL] Request: ES 3.1 RGB0 000 0/0
D/Unity   (27860): [EGL] Request: ES 3.0 RGB0 000 0/0
D/Unity   (27860): [EGL] Found: ID[1] ES 3.0 RGB16 565 0/0
D/Unity   (27860): GfxDevice: creating device client; threaded=1
D/Unity   (27860): [EGL] Request: ES 3.1+AEP RGB0 000 0/0
D/Unity   (27860): [EGL] Request: ES 3.1 RGB0 000 0/0
D/Unity   (27860): [EGL] Request: ES 3.0 RGB0 000 0/0
D/Unity   (27860): [EGL] Found: ID[1] ES 3.0 RGB16 565 0/0
D/Unity   (27860): [EGL] Request: ES 3.0 RGBA32 8888 0/0
D/Unity   (27860): [EGL] Found: ID[5] ES 3.0 RGBA32 8888 0/0
D/Unity   (27860): extension is supported with value 0
D/Unity   (27860): ANativeWindow: (1080/1920) RequestedResolution: (0/0) RenderingResolution: (0/0) EGLSurface: (1080/1920)
D/Unity   (27860): Renderer: Adreno (TM) 320
D/Unity   (27860): Vendor:   Qualcomm
D/Unity   (27860): Version:  OpenGL ES 3.0 V@84.0 AU@  (CL@)
D/Unity   (27860): GLES:     3
D/Unity   (27860):  GL_EXT_disjoint_timer_query
D/Unity   (27860): OPENGL LOG: Creating OpenGL ES 3.0 graphics device ; Context level  <OpenGL ES 3.0> ; Context handle -1659027776
D/Unity   (27860): [EGL] Attaching window :0x92744408
D/Unity   (27860): Requested framebuffer: resolution[1080x1920], rgba[8/8/8/8], depth+stencil[on], samples[1]
D/Unity   (27860): Created framebuffer: resolution[1080x1920], rgba[8/8/8/8], depth+stencil[24/8], samples[0]
D/Unity   (27860): [EGL] Attaching window :0x92744408
D/Unity   (27860): Initialize engine version: 2019.1.1f1 (fef62e97e63b)
D/Unity   (27860): PlayerInitEngineGraphics OK
D/Unity   (27860): Found 18 native sensors
D/Unity   (27860): Sensor :        Accelerometer ( 1) ; 0.000599 / 0.01s ; K330 3-axis Accelerometer / STMicroelectronics
D/Unity   (27860): Sensor :        Accelerometer ( 1) ; 0.000599 / 0.01s ; K330 3-axis Accelerometer / STMicroelectronics
D/Unity   (27860): UnloadTime: 0.396729 ms
D/Unity   (27860): UUID: aab26881f99a2a9f => 81faee63918747dccb54d006cbe036f5
D/Unity   (27860): Sensor :        Accelerometer ( 1) ; 0.000599 / 0.01s ; K330 3-axis Accelerometer / STMicroelectronics
D/Unity   (27860): Choreographer available: Enabling VSYNC timing
I/Unity   (27860): windowFocusChanged: false
I/Unity   (27860): onPause
D/Unity   (27860): Setting up 1 worker threads for Enlighten.
D/Unity   (27860):   Thread -> id: ffffffff997b5300 -> priority: 1
D/Unity   (27860): ASensorManager_destroyEventQueue returned 0
I/Unity   (27860): ##utp:{"type":"MemoryLeaks","version":2,"phase":"Immediate","time":1558014671523,"processId":27860,"allocatedMemory":149888,"memoryLabels":[{"Default":56},{"NewDelete":14976},{"Thread":4294967248},{"Manager":192},{"GfxDevice":4628},{"Audio":88},{"Serialization":24},{"Terrain":60},{"String":2604},{"DynamicArray":123976},{"Utility":1680},{"PoolAlloc":4294967236},{"ScriptManager":1416},{"VR":20},{"SceneManager":224},{"EditorGui":52}]}
I/Unity   (27860): onDestroy