NEED HELP ON --> ADMOB + UNITY for android: RewardedAd.Load not firing or getting errors I can not log in the app

84 views
Skip to first unread message

zeljko vasic

unread,
Jun 12, 2024, 12:42:48 PMJun 12
to Google Mobile Ads SDK Developers
So basically I am another one of these people stuck with making Google Admob work properly on their app.

I am implementing rewarded ads and testing with test ads (or at least trying to, before I start considering production code).

The code works fine in the unity editor and I manage to get the fake ads that are shipped within the Admob package displayed and progress the code to the point to reward users for watching those ads.

WHAT I TRIED:

1.Following the AdMob documentation for integration on my main app
2. Fresh project with bare minimum also following documentation
3. I use various AI helpers to code and debug my code, but even AI seems stuck on this giving me some half baked answers 
4. Searched the web, stack exchanges, forums, you name it (almost a week of struggles)
5. Logging the ad-displaying code progress points into a text field on the app to get more info where I am failing and I drilled it to the RewardedAd.Load function either not firing or failing without any logs to help me figure out what I am doing wrong/missing.

MY SUSPICIONS:

1. Either something is broken within the AdMob package (possible, but unlikely as I see people on you tube happily showing off how to do it and working for them, but none of what people suggest or explain really helps me because I did what they show or they aren't showing something "obvious" that I may be missing)

2. The SDK not being properly integrated so that the RewardedAd.Load fires properly --> this one is more likely a reason, but I have no idea where I could be wrong on this one as I followed the integration part from the AdMob for unity documentation. Since it works in the unity editor, I am thinking that the gradle files or manifests might be missing some important data which still lets the apk get built, but doesn't allow the function to fire properly in the app.  

As mentioned, I get no logs from the RewardedAd.Load function while using the app, so it's hard to figure out if I am missing some manifest file or gradle file code to make the built app code work or am I just dumb to not see the obvious.

Here is the LoadRewardedAd function with what I tried when debugging the problems on the actual app not the editor, because as said, in the editor works fine. Also to be more explicit on why I believe I drilled it to the  RewardedAd.Load function not working properly is that the log above the function gets logged and the one below it doesn't, which simply means something goes wrong there and code breaks not logging what is after it.

public void LoadRewardedAd()
    {

        if (!IsInternetAvailable())
        {
            Debug.LogError("No internet connection.");
            debugLogText.text += "No internet connection.\n\n";
            return;
        }

        if (rewardedAd != null)
        {
            rewardedAd.Destroy();
            rewardedAd = null;
        }

        Debug.Log("Loading the rewarded ad.");
        debugLogText.text = "Loading the rewarded ad. \n\n";


        RewardedAd.Load(rewardedAdUnitId, new AdRequest(),
            (RewardedAd ad, LoadAdError error) =>
            {
                if (error != null || ad == null)
                {
                    Debug.LogError("Rewarded ad failed to load: " + error.GetMessage());
                    debugLogText.text += "Rewarded ad failed to load: " + error.GetMessage() + "\n\n";
                    return;
                }

                Debug.Log("Rewarded ad loaded with response: " + ad.GetResponseInfo());
                debugLogText.text += "Rewarded ad loaded with response: " + ad.GetResponseInfo() + "\n\n";
                rewardedAd = ad;
                RegisterEventHandlers(rewardedAd);
            });
        debugLogText.text = "This won't happen if the AD LOADING breaks. \n\n";
    }

Hopefully there is someone with more experience who will see the obvious I am not seeing and help me drill this down. Also if you need more parts of the code or contents in the manifest and gradle files ask away, if it helps you drill to the possible problem. I didn't want to spam the post with too much code and files as I have no idea which files could be poorly edited and in which specific locations of the project, so just wanted to try and explain my issue for starters and go from there if anyone can make sense from what I posted and is able to help.

THX IN ADVANCE FOR YOUR TIME 


Mobile Ads SDK Forum Advisor

unread,
Jun 12, 2024, 11:13:36 PMJun 12
to dri...@gmail.com, google-adm...@googlegroups.com
Hi,

I see that you are facing issue with reward ads in unity. Kindly provide us below details via "Reply to author" option for further investigation:
  • app ID
  • ad unit ID
  • Error logs
  • Unity editor version
  • Mobile Ads SDK version
This message is in relation to case "ref:!00D1U01174p.!5004Q02tJIuP:ref" (ADR-00239939)

Thanks,
 
Google Logo Mobile Ads SDK Team


Mobile Ads SDK Forum Advisor

unread,
Jun 13, 2024, 1:26:53 PMJun 13
to dri...@gmail.com, google-adm...@googlegroups.com

Hi Zeljko,

It is always recommended to keep the SDKs up to date to avoid such issues. 

Could you confirm whether you are facing same issue with our sample project. If you are able to run our sample project in your device then there might be some issue in your implementation. If you unable to run our sample project then kindly provide the below information for further investigation:

  • Sample project reproducing the issue
  • Steps to replicate

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files to us via reply to author option or using the steps below:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002tJIuPQAW&entry.80707362=00239939

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

Reply all
Reply to author
Forward
0 new messages