googleads-mobile-unity icon indicating copy to clipboard operation
googleads-mobile-unity copied to clipboard

Ads not initialising on Android

Open LukaRadivoj opened this issue 4 years ago • 4 comments
trafficstars

[REQUIRED] Step 1: Describe your environment

  • Unity version: 2020.3.19f1
  • Google Mobile Ads Unity plugin version: 6.1.1
  • Platform: Android (iOS, Android, Unity Editor)
  • Platform OS version: Android 10 (eg iOS 10, Android 9)
  • Any specific devices issue occurs on: General
  • Mediation ad networks used, and their versions: No mediation

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

Hello!

I've been implementing the AdMob ads via Google Mobile Ads Unity plugin in my Unity game. The project works in when running in the Unity Editor or when I build the project to iOS. When I try to run the Android build, which succeeds, the initialisation process of the game gets stuck while trying to initialise the Mobile Ads. The dependancies have been resolved successfully and the game gets no error. The only warning I could find that could be related to this is the following:

Warn GmsClient unable to connect to service: com.google.android.gms.leibniz.events.service.START on com.google.android.gms

The Initialise function also does not call the callback function. I am stumped because the iOS build is working without an issue without any problems. The following code is the initialisation function of the wrapper used to decouple the ad serving process. The first Debug.Log gets called while the second one inside the action does not. It also means that the RefeshAds function also does not get called.

Relevant Code:

public void InitializeAdController() { this.masterAdControllerInitialization = true; #if UNITY_IOS this.adsConfiguration = this.iosAdsConfiguration; #elif UNITY_ANDROID this.adsConfiguration = this.androidAdsConfiguration; #elif UNITY_EDITOR this.adsConfiguration = this.iosAdsConfiguration; #endif

    Debug.Log("Starting Ads Initialization");
    MobileAds.Initialize(initializationStatus =>
    {
        Debug.Log("Action Started");
        Dictionary<string, AdapterStatus> adapterStatusMap = initializationStatus.getAdapterStatusMap();
        bool initializationDone = true;
        foreach (AdapterStatus adapterStatus in adapterStatusMap.Values)
        {
            if (adapterStatus.InitializationState == AdapterState.NotReady)
            {
                initializationDone = false;
                break;
            }
        }
        if (initializationDone)
        {
        RefreshAds();
        }
    });
}

LukaRadivoj avatar Oct 19 '21 12:10 LukaRadivoj

Same here .. any luck solving ?

khalidhex avatar Nov 27 '21 07:11 khalidhex

Any update?

FlynnMacfarlane92 avatar Dec 01 '21 11:12 FlynnMacfarlane92

i have a same problem. Can you fix this problem? if you can how?

srtcoztrk avatar Jan 13 '22 13:01 srtcoztrk

I'm also having this issue

LMBooth avatar Sep 02 '22 15:09 LMBooth

Closing this issue as obsolete and not replicated on the most recent version. If you still have issues, please reopen.

NVentimiglia avatar Jan 26 '23 23:01 NVentimiglia