Flutter: Ad failed to load : 1

1.7k views Asked by At

I am using the google_mobile_ads package. And it is showing me this error. I am trying to user rewarded video test ads. And they are not loading.

Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("7D77F0F7912B63850A1FB8986F58DE38") to get test ads on this device.
 Not retrying to fetch app settings
2

There are 2 answers

0
Marcel Dz On

Add this lines:

List<String> testDeviceIds = ['YOUR DEVICE ID'];
  RequestConfiguration configuration = RequestConfiguration(testDeviceIds: testDeviceIds);
  await MobileAds.instance.updateRequestConfiguration(configuration);

make sure to use await since its an async function

Getting the device id:

Simply run your app and request the rewarded ad. You will get some errors in the log, search for this line. The highlighted part is your device id you can add: RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("**289234E6**")

1
tolulope oke On

You need to add the device you are using to the list of test devices to get test ads on it:

await MobileAds.instance.initialize();

Add this after initialization:

MobileAds.instance.updateRequestConfiguration(
    RequestConfiguration(
        tagForChildDirectedTreatment: 
      TagForChildDirectedTreatment.unspecified,
        testDeviceIds: <String>[
          "7D77F0F7912B63850A1FB8986F58DE38",
        ],
   ),
);