Skip to content

Admob Banner Ad FailedToLoad => nativeToJSError  #2054

@SMKH-PRO

Description

@SMKH-PRO

Dear React-Native-Firebase Team.

I have not tried other ads, but i am using Admob banners ad, I created my ad unit on admob 2 days ago (48Hours) and i am trying to request ads since yesterday!.. but it always fails to load the ad

When i am on Emulator it shows test ads without errors, but to check real ads i had to run app on real device so on real device i am always getting failed to load error nativeToJSError

in the start i thought that it may take sometime for admob to be providing ads on my app, but its now been 48 hours!. seems like a bug in the library....

i have seen many issues on the same error but they all are closed without any solution even same error was posted on stack-overflow by someone else, but no solution was there as well, so i had to open new issue !...

Error

Ad Failed To Load Trigger=>     at nativeToJSError (blob:http://localhost:8081/dddcefb4-6e0a-4359-9192-09364c9a66df:143287:17)
    at AdMobComponent._this.onBannerEvent (blob:http://localhost:8081/dddcefb4-6e0a-4359-9192-09364c9a66df:144169:64)
    at Object.invokeGuardedCallbackImpl (blob:http://localhost:8081/dddcefb4-6e0a-4359-9192-09364c9a66df:21531:16)
    at invokeGuardedCallback (blob:http://localhost:8081/dddcefb4-6e0a-4359-9192-09364c9a66df:21622:37)
    at invokeGuardedCallbackAndCatchFirstError (blob:http://localhost:8081/dddcefb4-6e0a-4359-9192-09364c9a66df:21626:31)
    at executeDispatch (blob:http://localhost:8081/dddcefb4-6e0a-4359-9192-09364c9a66df:21820:9)
    at executeDispatchesInOrder (blob:http://localhost:8081/dddcefb4-6e0a-4359-9192-09364c9a66df:21840:11)
    at executeDispatchesAndRelease (blob:http://localhost:8081/dddcefb4-6e0a-4359-9192-09364c9a66df:21935:11)
    at executeDispatchesAndReleaseTopLevel (blob:http://localhost:8081/dddcefb4-6e0a-4359-9192-09364c9a66df:21944:16)
    at forEachAccumulated (blob:http://localhost:8081/dddcefb4-6e0a-4359-9192-09364c9a66df:21927:14)

and on my Admob there are 0 Requests made!....

I have also tried the release APK the result is same on the release apk.

My BannerAd Component:-

import React, { Component } from 'react'
import firebase from 'react-native-firebase' //Native firebase sdk 
firebase.admob().initialize("ca-app-pub-2326409939639613~3654060702") 

const Banner = firebase.admob.Banner;
const AdRequest = firebase.admob.AdRequest;
const request = new AdRequest();
request.addKeyword('coins');
request.addKeyword('hosting');
request.addKeyword('free');
request.addKeyword('cheap');
request.addKeyword('hosting');
request.addKeyword('crypto');
request.addKeyword('bitcoin');


export default class AdmobBanner extends Component {


  render() {

const {size}=this.props  // <BannerAd size="FULL_BANNER" />

return <Banner
      size={size}

      onAdLoaded={() =>console.log('Ad loaded')}

      request={request.build()}

      unitId="ca-app-pub-2326409939639613/1792036892"

      onAdFailedToLoad={(e)=>console.log('Ad Failed To Load Trigger=>',e)}
    />

  }
}



On other pages to show banner i am importing this component and rendering as
<BannerAd size="FULL_BANNER" /> . just shows blank screen and error on the console!.....

I have also tried creating new Ad Unites but none works!...

More details:-

Platform: Android (Have not tried on iOS)
Operating System: Windows.
TypeScript: No
Expo: No

Modules i am using:-

  1. Notifications/FCM
  2. Database
  3. Admob
  "dependencies": {
    "grpc": "^1.19.0",
    "lottie-react-native": "^2.6.1",
    "react": "16.8.3",
    "react-native": "0.59.3",
    "react-native-actionsheet": "^2.4.2",
    "react-native-app-settings": "^2.0.1",
    "react-native-fbsdk": "^0.8.0",
    "react-native-firebase": "^5.2.3",
    "react-native-gesture-handler": "^1.1.0",
    "react-native-google-signin": "^1.2.2",
    "react-native-iap": "^2.4.7",
    "react-native-image-progress": "^1.1.1",
    "react-native-image-slider": "^2.0.3",
    "react-native-paper": "^2.14.0",
    "react-native-paypal-wrapper": "^1.3.2",
    "react-native-rate": "^1.1.6",
    "react-native-render-html": "^4.1.2",
    "react-native-splash-screen": "^3.2.0",
    "react-native-vector-icons": "^6.4.2",
    "react-navigation": "^3.5.1"
  }

Build.Gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
        
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'

        classpath 'com.google.gms:google-services:4.0.1' //for push


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        google() //RN FIrebase for push
        jcenter() // rn firebase fo rpush
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions