Fail to load ad?

33 views
Skip to first unread message

Zhen Liu

unread,
Aug 19, 2024, 10:12:43 PMAug 19
to Google Mobile Ads SDK Developers
See this error when running this code. I configured my com.google.android.gms.ads.APPLICATION_ID
with the app id on see on ad manager, and updated the xxxxx ad unit id with the unit id in ad manager. But I still see errors. Any idea why? Could anyone help.

RewardedAd.load(mMainActivity, "xxxxxxxxx",
new AdRequest.Builder().build(), new RewardedAdLoadCallback() {
@Override
public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {
// Handle the error.
Log.d(TAG, loadAdError.toString());
mRewardedAd = null;
}

@Override
public void onAdLoaded(@NonNull RewardedAd ad) {
Log.
d(TAG, "Ad was loaded.");
mRewardedAd = ad;

ServerSideVerificationOptions options =
new ServerSideVerificationOptions
.Builder()
.setCustomData(
"SAMPLE_CUSTOM_DATA_STRING")
.build();
mRewardedAd.setServerSideVerificationOptions(options);

}
});

{
                                                                                                      "Code": 1,
                                                                                                      "Message": "Error building request URL: Cannot determine request type. Is your ad unit id correct?",
                                                                                                      "Domain": "com.google.android.gms.ads",
                                                                                                      "Cause": "null",
                                                                                                      "Response Info": {
                                                                                                        "Response ID": "null",
                                                                                                        "Mediation Adapter Class Name": "",
                                                                                                        "Adapter Responses": [],
                                                                                                        "Response Extras": {}
                                                                                                      }
                                                                                                    }

Thanks
Zhen

Mobile Ads SDK Forum Advisor

unread,
Aug 20, 2024, 1:12:15 AMAug 20
to google-adm...@googlegroups.com

Hi Zhen,

Thank you for contacting the Mobile Ads SDK Support team.

Error code 1: ERROR_CODE_INVALID_REQUEST, The ad request was invalid; for instance, the ad unit ID was incorrect.

This commonly suggests that the Ad Request implementation is not as per the SDK’s requirements - Resources like the  sample codes and sample apps provided in the developer documentation can help in implementing the functions correctly. You can check our Google Sample Project for reference.

Would you be so kind as to verify the accuracy of your ad unit ID and make the necessary correction in the sample project.

If the issue still persists, kindly provide the below information via the reply to author option, so that we will review your account and let you know why ads aren’t showing.

  • app ID
  • ad unit ID 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vF8fZ:ref" (ADR-00263970)

Thanks,
 
Google Logo Mobile Ads SDK Team


Reply all
Reply to author
Forward
0 new messages