react-native-admob icon indicating copy to clipboard operation
react-native-admob copied to clipboard

Can't import the module: undefined is not an object (evaluating '_react3.default.PropTypes.string')

Open mattveraldi opened this issue 9 years ago • 5 comments

Hello, I installed and linked react-native-admob as written on the README. I followed each step but when I import the library like that: import {AdMobBanner} from "react-native-admob" it appears an error saying "undefined is not an object (evaluating '_react3.default.PropTypes.string')". I tried to reset cache, delete node-modules folder and reinstall it, I tried to reinstall react-native-admob and still it doesn't work.

here is my package.json file:

{ "name": "TransposeIT", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "react": "16.0.0", "react-native": "0.50.1", "react-native-admob": "^1.3.2", "react-native-vector-icons": "^4.4.2", "react-navigation": "^1.0.0-beta.19", "react-redux": "^5.0.6", "redux": "^3.7.2", "redux-thunk": "^2.2.0" }, "devDependencies": { "babel-jest": "21.2.0", "babel-preset-react-native": "4.0.0", "jest": "21.2.1", "react-test-renderer": "16.0.0" }, "jest": { "preset": "react-native" }, "rnpm": { "assets": [ "./fonts/" ] } }

Can anybody help me please?

mattveraldi avatar Nov 08 '17 11:11 mattveraldi

See https://github.com/sbugert/react-native-admob/pull/182

You probably won't understand what's going on without reading it a few times. Basically the latest release of this library is not compatible with the recent changes in react native so either use an older version of react native or a beta version of this library that includes the fix

martinlockett avatar Nov 09 '17 16:11 martinlockett

@mattveraldi install the package using react-native-admob@next

theeomm avatar Nov 10 '17 17:11 theeomm

Like the @martinlockett and @TheeOMM said; the 1.x version is not compatible with the latest versions of React Native.

koenpunt avatar Nov 12 '17 21:11 koenpunt

How to fixed the problem. ? I don't understand.

krkmzugur avatar May 06 '18 07:05 krkmzugur

How to fixed the problem. ? I don't understand.

@krkmzugur Yo can upgrade admob version.

mustafakucuk avatar Oct 15 '18 09:10 mustafakucuk