AppLovin / AppLovin-MAX-Unity-Plugin

121 stars 33 forks source link

Debug [AppLovin MAX] Invoking event continously, clogging up console log. #172

Closed jacattrongnlh closed 2 years ago

jacattrongnlh commented 2 years ago

I load a banner only once and it failed, then I get this message logged in console continously, it logged multiple times a seconds.

Debug [AppLovin MAX] Invoking event: System.Action2[System.String,MaxSdkBase+ErrorInfo]. Params: (ID), [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

MaxSdkCallbacks:InvokeEvent(Action2, T1, T2)
MaxSdkCallbacks:ForwardEvent(String)

It also invoke the callback MaxSdkCallbacks.Banner.OnAdLoadFailedEvent which I'm using to log Firebase event so if this happens in release build, it'll clog up my Firebase which is unwanted.

Expected behavior: When banner failed to load, error should only be logged once.

Unity version: 2020.3.18

MAX Unity Plugin version: 5.4.3.

jacattrongnlh commented 2 years ago

Here are the relevant codes:

        public void InitializeBannerAds()
        {
            MaxSdkCallbacks.Banner.OnAdLoadFailedEvent += OnBannerAdLoadFailedEvent;
        }

        private void OnBannerAdLoadFailedEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
        {
            QueueMainThreadExecution(() =>
            {
                GetCurrentBannerAd().State = AdObjectState.LoadFailed;
                onBannerAdLoadFailedEvent?.Invoke(GetCurrentBannerAd().AdPlacementType, errorInfo);
            });
        }

        public static void QueueMainThreadExecution(Action action)
        {
#if UNITY_ANDROID
            UnityMainThreadDispatcher.Instance().Enqueue(() =>
            {
                action.Invoke();
            });
#else
        action.Invoke();
#endif
        }

I used UnityMainThreadDispatcher since other ad networks like IronSource & Admob do not use Unity's main thread to execute callbacks so I expected AppLovin's MAX to do the same, so I used UnityMainThreadDispatcher to invoke MAX's callbacks.

UnityMainThreadDispatcher: https://github.com/PimDeWitte/UnityMainThreadDispatcher

santoshbagadi commented 2 years ago

Hi @jacattrongnlh , AppLovin SDK sends back an OnAdLoadFailedEvent each time the ad fails to load during while it is being refreshed. So, it is common to see OnAdLoadFailedEvent at the refresh intervals, but it is not expected that they are called multiple times within a second.

If you are seeing that the callbacks are being called multiple times outside the refresh interval, please send us verbose logs of the session so we can investigate further.

jacattrongnlh commented 2 years ago

Hi @santoshbagadi. Is there any way I can send the log to your privately?

jacattrongnlh commented 2 years ago

Here is the log

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> IAP Helper not initialized

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Curl error 7: Failed to connect to cdp.cloud.unity3d.com port 443: Connection refused

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Admob Init: GoogleMobileAds.Api.InitializationStatus

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Firebase Analytics API Initializing

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> OnInitialized: PASS

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Invalid receipt, not unlocking content

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Using Facebook Unity SDK v11.0.0 with FBAndroidSDK/11.3.0

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Curl error 7: Failed to connect to cdp.cloud.unity3d.com port 443: Connection refused

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Firebase Analytics API Initializing

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> analytics API Initialized

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Firebase Cloud Messaging API Initialized

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Received Registration Token: 

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> FCM Token: 

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Installations token 

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Firebase ready: True

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Fetching data...

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Fetch async done

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`1[MaxSdkBase+SdkConfiguration]. Param: MaxSdkBase+SdkConfiguration

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Curl error 7: Failed to connect to cdp.cloud.unity3d.com port 443: Connection refused

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Error message is longer than 40 characters. Excess characters will be trimmed

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Invalid receipt, not unlocking content

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Look rotation viewing vector is zero

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Look rotation viewing vector is zero

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Look rotation viewing vector is zero

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Look rotation viewing vector is zero

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Look rotation viewing vector is zero

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Error message is longer than 40 characters. Excess characters will be trimmed

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Look rotation viewing vector is zero

<.....i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Look rotation viewing vector is zero

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Error message is longer than 40 characters. Excess characters will be trimmed

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Curl error 7: Failed to connect to cdp.cloud.unity3d.com port 443: Connection refused

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]

<i>AndroidPlayer(OPPO_CHP1723@192.168.1.36)</i> Debug [AppLovin MAX] Invoking event: System.Action`2[System.String,MaxSdkBase+ErrorInfo]. Params: [ad id 2], [ErrorInfo code: NoFill, message: MAX returned no eligible ads from any mediated networks for this app/device., adLoadFailureInfo: ]
.

Aside from these log in Unity Editor, I also see these in LunarConsole logged on the phone.

https://files.catbox.moe/mkoose.png

https://files.catbox.moe/isqawb.png

https://files.catbox.moe/f3skj0.png

santoshbagadi commented 2 years ago

Do you mind sending the logs for the full session to santosh.bagadi@applovin.com.

jacattrongnlh commented 2 years ago

I've sent the log to your email

santoshbagadi commented 2 years ago

@jacattrongnlh we have released a backend fix that should solve this problem. Please let us know if you are still seeing the issue.