Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined is not an object(reactNative.View.PropType.style') #391

Open
vshalvaghasiya opened this issue Dec 19, 2018 · 7 comments
Open

Undefined is not an object(reactNative.View.PropType.style') #391

vshalvaghasiya opened this issue Dec 19, 2018 · 7 comments

Comments

@vshalvaghasiya
Copy link

vshalvaghasiya commented Dec 19, 2018

<AdMobBanner
          adSize="fullBanner"
          adUnitID="ca-app-pub-9757359219487544/6438054726"
          testDevices={[AdMobBanner.simulatorId]}
          onAdFailedToLoad={error => console.error(error)}
        />

simulator screen shot - iphone xr - 2018-12-19 at 11 16 40

@hasnabbas
Copy link

I am facing the same issue, did you find a solution?

@jdgalani
Copy link

jdgalani commented Dec 29, 2018

Step-1. Add below line at top in node-modules/react-native-admob/RNAdmobBanner.js and RNPublisherBanner.js

import PropTypes from "prop-types";

Step-2. Delete these line from both file(May be line no is 48 and 50 respective)

style: View.propTypes.style

note: style property of AdmobBanner is not working at all so you can delete this because this is creating issue.

Step-3. Change this words in both file

React.PropTypes ===> to ===> PropTypes

old Content=>

bannerSize: React.PropTypes.string,
adUnitID: React.PropTypes.string,
testDeviceID: React.PropTypes.string,
adViewDidReceiveAd: React.PropTypes.func,
didFailToReceiveAdWithError: React.PropTypes.func,
adViewWillPresentScreen: React.PropTypes.func,
adViewWillDismissScreen: React.PropTypes.func,
adViewDidDismissScreen: React.PropTypes.func,
adViewWillLeaveApplication: React.PropTypes.func,
admobDispatchAppEvent: React.PropTypes.func,

new content should be like this=>

bannerSize: PropTypes.string,
adUnitID: PropTypes.string,
testDeviceID: PropTypes.string,
adViewDidReceiveAd: PropTypes.func,
didFailToReceiveAdWithError: PropTypes.func,
adViewWillPresentScreen: PropTypes.func,
adViewWillDismissScreen: PropTypes.func,
adViewDidDismissScreen: PropTypes.func,
adViewWillLeaveApplication: PropTypes.func,
admobDispatchAppEvent: PropTypes.func,

@hasnabbas
Copy link

Actually using latest version of admob solved it.

@amnan181
Copy link

amnan181 commented Jan 1, 2019

please send version

@emilantonov
Copy link

what I did was:

  1. yarn remove react-native-admob
  2. yarn add react-native-admob@next

@ghost
Copy link

ghost commented Aug 10, 2019

I just tried to implement it (v.1.3.2) and still facing this exception for interstitial Ads, but in fact it seems this is triggered on the momment of Import - how to handle it?

@charlyBerthet
Copy link

charlyBerthet commented Sep 1, 2019

Also still facing this issue.
"react-native-admob": "^2.0.0-beta.5" fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants