sbugert / react-native-admob

A react-native component for Google AdMob banners
BSD 2-Clause "Simplified" License
1.13k stars 532 forks source link

Admob crashes whole app on production #534

Closed martynaskre closed 3 years ago

martynaskre commented 3 years ago

Im trying to debug my app using react-native run-android --variant=release and while opening app it totally crashes with error Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

My code for displaying an add is the same as in docs.

<AdMobBanner adSize="banner" adUnitID="ca-app-pub-4093042818195907/********" testDevices={[ AdMobBanner.simulatorId ]} />

I linked this library using react-native link and I have specified my APP_ID in AndroidManifest.xml

timorss commented 3 years ago

make sure u update the AndroidManifest.xml, as described in the Google Mobile Ads SDK documentation. https://developers.google.com/admob/android/quick-start#update_your_androidmanifestxml