Home » Android » android – AdMob RewardedVideoAd.loadAd always returns "failed to load ads, error code: 0"

android – AdMob RewardedVideoAd.loadAd always returns "failed to load ads, error code: 0"

Posted by: admin June 15, 2020 Leave a comment


I’m using firebase-ads:9.2.0 with API level 24.

And unity-ads aar module is imported by adding compile(name:’unity-ads’, ext:’aar’) to my build.gradle.

Everything goes fine if I choose to use UnityAds API directly.

But when I try to integrate unity-ads with AdMob like this:

    mRewardedVideoAd = MobileAds.getRewardedVideoAdInstance( this );

    mRewardedVideoAd.setRewardedVideoAdListener(new RewardedVideoAdListener() {
        public void onRewardedVideoAdLoaded() {

        public void onRewardedVideoAdOpened() {

        public void onRewardedVideoStarted() {

        public void onRewardedVideoAdClosed() {

        public void onRewarded(RewardItem rewardItem) {

        public void onRewardedVideoAdLeftApplication() {

        public void onRewardedVideoAdFailedToLoad(int i) {
                Toast.LENGTH_SHORT ).show();

    AdRequest adRewardRequest = new AdRequest.Builder()

        adRewardRequest );

It always returns

There was a problem getting an ad response. ErrorCode: 0
Failed to load ad: 0.

Is there anything I did it in the wrong way?

Or I just missed some steps?

Here is my AdMob page screenshot:

AdMob page

How to&Answers:

Okay, I found solutions.

The first thing is that I didn’t include adapters in my project.

I have to download the adpaters here:
Third-party network adapters

And put it into the libs folder.
These adapters are not included in the SDKs(if you download it from github).

Second, I have to remove this line out of my code.


It seems like if the AdMob treat this device as a test device, there will be no any video ad to be downloaded(at least in my case).

Same thing happens if I choose to use the AVD, they force to show test ads on these emulators.

So I change to Genymotion, remove the addTestDevice() and then it works.


Usually this happens for newly created ads, so wait for an hour and
try again.

public static final int ERROR_CODE_INTERNAL_ERROR

Something happened internally; for instance, an invalid response was received from the ad server.

Constant Value: 0

Source: Google Developers


I’m using interstitial ads, but I believe it is the same problem. Google sometimes gives code that doesn’t work, don’t ask me why is that.

Add this after your mRewardedVideoAd.loadAd() method:

mRewardedVideoAd.setAdListener(new AdListener() {
        public void onAdLoaded() {
            //your code when Ad is loaded
            //you can show your ad immediately, but I don't suggest it
            if (mRewardedVideoAd.isLoaded()) {
                mRewardedVideoAd.show(); //this shows ad immediately

        public void onAdClosed() {

Or you can set the AdListener, don’t show it immediately, but rather make a new method:

public static void displayAd() {
    if (mRewardedVideoAd.isLoaded()) {

And this way, you can call this method from any activity, which shows the ad almost instantly (because it was already loaded), without the need to loading it again.