invertase / react-native-firebase

πŸ”₯ A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.7k stars 2.22k forks source link

Admob Test Ads Working Production ids are failing to load #2006

Closed dileepbolisetti closed 5 years ago

dileepbolisetti commented 5 years ago

Screen Shot 2019-03-27 at 11 04 27 AM

Issue

Admob is working with test ids but failing to load with production ids with the error on onAdFailedToLoad==>("at nativeToJSError"). not sure whats the problem i cross check the ad ids they are proper and good


Project Files

iOS

ios/Podfile:

# N/A

AppDelegate.m:

// N/A

Android

android/build.gradle:

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

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath 'com.google.gms:google-services:4.0.1'
        classpath 'com.google.firebase:firebase-plugins:1.1.5'
        classpath 'io.fabric.tools:gradle:1.25.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex')) {
                details.useVersion "27.0.2"
            }
        }
    }
}

android/app/build.gradle:

// Library as defined in settings.gradle
  implementation project(':react-native-firebase')
  // Required dependencies
  //noinspection GradleCompatible
  implementation "com.google.firebase:firebase-core:16.0.6"
  implementation "com.google.android.gms:play-services-base:16.0.1"

  /* -------------------------
   *   OPTIONAL FIREBASE SDKS
   * ------------------------- */

  implementation('com.google.firebase:firebase-ads:15.0.1') {
    // exclude `customtabs` as the support lib version is out of date
    // we manually add it as a dependency below with a custom version
    exclude group: 'com.android.support', module: 'customtabs'
  }

  // Authentication
  implementation "com.google.firebase:firebase-auth:16.1.0"
  // Analytics
  implementation "com.google.firebase:firebase-analytics:16.0.6"
  // Performance Monitoring
  implementation "com.google.firebase:firebase-perf:16.2.3"
  // Remote Config
  implementation "com.google.firebase:firebase-config:16.1.2"
  // Cloud Storage
  implementation "com.google.firebase:firebase-storage:16.0.5"
  // Invites
  implementation "com.google.firebase:firebase-invites:16.0.6"
  // Dynamic Links
  implementation "com.google.firebase:firebase-dynamic-links:16.1.5"
  // Real-time Database
  implementation "com.google.firebase:firebase-database:16.0.5"
  // Cloud Functions
  implementation "com.google.firebase:firebase-functions:16.1.3"
  // Cloud Firestore
  implementation "com.google.firebase:firebase-firestore:17.1.5"
  // Cloud Messaging / FCM
  implementation "com.google.firebase:firebase-messaging:17.3.4"
  // Crashlytics
  implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
    transitive = true
  }

  /* --------------------------------
   *  OPTIONAL SUPPORT LIBS
   * -------------------------------- */

  // For Firebase Ads
  implementation "com.android.support:customtabs:27.1.1"

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->

Environment


Think react-native-firebase is great? Please consider supporting the project with any of the below:

dileepbolisetti commented 5 years ago

in Prod Apks with prod ids working

SMKH-PRO commented 5 years ago

@dileepbolisetti i am getting the same error can you explain how did your error solve?

I Test ads are working but products ids are giving this error " nativeToJSError " and in release apk admob just shows blank white screen.

BlaShadow commented 4 years ago

what was the solution for this error @dileepbolisetti? I think I'm having the same error.