I get this error on Android when I use
<AdMobBanner
bannerSize="smartBannerPortrait"
adUnitID={admob.banner}
adViewDidReceiveAd={null}
testDeviceID={__DEV__ ? 'EMULATOR' : ''}
didFailToReceiveAdWithError={bannerError}
/>
I can imagine that the component is rendered before admob.banner has a value?
Maybe try:
```jsx
{ admob.banner &&
}
has the same problem.I use 2.0.0 beta
@kidmysoul please show an example of how you're using this banner. If you check out the example project in the repo you'll see it works just fine there, so it should be something related to how the library is used.
Oh btw, the 2.0 has an adSize property instead of bannerSize
@koenpunt
can't get it work. My code is simple like:
import { AdMobBanner } from 'react-native-admob'
render() {
return (
<View style={styles.container}>
<MyNavigator />
{Platform.OS === 'android' &&
<AdMobBanner
adUnitID="ca-app-pub-1213123123123123123"/> }
</View>
);
}
and I use 2.0.0 beta
"react-native-admob": "^2.0.0-beta.2",
@koenpunt
I finally got it work by add "adSize="banner"
but in the 1.* version, if no adSize property provided, the ad will automatically adjust it's width to the device width. How to do it in version 2? the "adSize="banner"" forces the width to 50 which looked not very well.

@kidmysoul please open a new issue if you have problems with positioning, because that's no longer related to this issue.
@gsdias that you close this is because your problem is now solved?
The error is no longer there. At least using test id.
Good :)
@koenpunt
I finally got it work by add "adSize="banner"
it solved my problem. But not centered or it does not use device width.
but in the 1.* version, if no adSize property provided, the ad will automatically adjust it's width to the device width. How to do it in version 2? the "adSize="banner"" forces the width to 50 which looked not very well.
if you use adSize instead of bannerSize it will be solved.
Most helpful comment
Oh btw, the 2.0 has an
adSizeproperty instead ofbannerSize