React Native Google Mobile Ads Expo

468 views Asked by At

I have an application that I just started in expo. It was working fine until I added the 'react-native-google-mobile-ads' package to the application, but after adding it, it started throwing the following errors constantly. Although I did all the configurations, I couldn't find any way.

Expo SDK 0.48 React Native 0.71.8

"react-native-google-mobile-ads": "^11.1.1"

enter image description here

3

There are 3 answers

0
bagi2info.com On BEST ANSWER

you need to use Expo feature called Expo Development Build

this is step how to run it:

  1. add expo package expo-dev-client yarn add expo-dev-client

  2. create the new build

eas --platform android --profile development

eas --platform ios --profile development

  1. copy the build on simulator or device

  2. run the expo

expo start --dev-client

  1. open the build on the device, you new package should be run correctly
1
Idrees On

The reason is that Expo is not able to compile the native code. For testing purposes, you can use the command npx expo prebuild and run the app on the simulators or on the real device. Follow Expo's documentation for more information.

1
rrcabrera9625 On

react-native-google-mobile-ads does not work with Expo Go, you must use dev-client instead.