question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ad working in expo client but in android standalone app: ERROR_CODE_NO_FILL

See original GitHub issue

🐛 Bug Report

Environment

expo diagnostics:

  Expo CLI 3.0.10 environment info:
    System:
      OS: macOS 10.14.6
      Shell: 3.0.2 - /usr/local/bin/fish
    Binaries:
      Node: 10.16.0 - /usr/local/bin/node
      Yarn: 1.17.3 - /usr/local/bin/yarn
      npm: 6.10.3 - /usr/local/bin/npm
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5692245
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^34.0.1 => 34.0.4 
      react: 16.8.3 => 16.8.3 
      react-native: https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz => 0.59.8 
      react-navigation: ^3.0.9 => 3.11.1 

App’s target: Android (standalone, apk)

Steps to Reproduce

I’m using managed workflow.

import { AdMobBanner } from 'expo-ads-admob';

// And then used somewhere in the render method
<AdMobBanner
  bannerSize="banner"
  adUnitID={
    Platform.OS === 'ios'
      ? settings.IOSAdUnitID
      : settings.AndroidAdUnitID
  }
  testDeviceID="EMULATOR"
  onDidFailToReceiveAdWithError={handleError}
/>

Expected Behavior

Running app through Expo app

IOS: banner shows properly Android: banner shows properly

Running app through standalone versions

IOS: banner shows properly Android: banner should show properly

Actual Behavior

Running app through Expo app

IOS: banner shows properly Android: banner shows properly

Running app through standalone versions

IOS: banner shows properly Android: banner does not show. onDidFailToReceiveAdWithError will be triggered, and based on my logs, it’s receiving ERROR_CODE_NO_FILL. And sometimes I would also log some more detailed error.

Admob failed: Error Domain=com.google.ads Code=1 “Request Error: No ad to show.”

Reproducible Demo

import React from 'react';
import { View, Platform } from 'react-native';
import { shape } from 'prop-types';
import { AdMobBanner } from 'expo-ads-admob';

import settings from '../../constants/AdmobSettings';

import styles from './Ads.style';

function Ads({ style }) {
  function handleError(error) {
    // some remote logging thingy here
  }

  return (
    <View style={[styles.container, style]}>
      <AdMobBanner
        bannerSize="banner"
        adUnitID={
          Platform.OS === 'ios'
            ? settings.IOSAdUnitID
            : settings.AndroidAdUnitID
        }
        testDeviceID="EMULATOR"
        onDidFailToReceiveAdWithError={handleError}
      />
    </View>
  );
}

Ads.propTypes = {
  style: shape({}),
};

export default Ads;

NOTE: I’m aware that #4684 is somewhat similar, but this one is using AdMobBanner and the error code is somewhat different.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dceframcommented, Dec 23, 2019

Yes, the ads seemed to be working when deployed to play store 😃

2reactions
ragragcommented, Dec 22, 2019

the issue is solved when you deploy the app to the play store

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does standalone react-native app doesn't work but works ...
I am building a react native app, things work fine on expo client. But I am getting: 'Uncaught Error: Error calling AppRegistry.runApplication' ...
Read more >
Building Standalone Apps - Expo Documentation
An Apple Developer account is required to build a standalone iOS app, but a Google Play Developer account is not required to build...
Read more >
Hi, I'm one of the co-founders of Expo and have worked on it ...
Hi, I'm one of the co-founders of Expo and have worked on it for several years and have the context for why Expo...
Read more >
Expo Auth Session for Google Authentication on React Native ...
I will also show you what the code should look like when it is fixed for Android standalone apps in the future, and...
Read more >
Set up mobile device targeting - Google Ads Help
These settings let you focus your ads on specific types of devices. ... For campaigns that show app promotion ads or other mobile-only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found