Can't import the module: undefined is not an object (evaluating '_react3.default.PropTypes.string')
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?
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
@mattveraldi install the package using react-native-admob@next
Like the @martinlockett and @TheeOMM said; the 1.x version is not compatible with the latest versions of React Native.
How to fixed the problem. ? I don't understand.
How to fixed the problem. ? I don't understand.
@krkmzugur Yo can upgrade admob version.