简体   繁体   中英

React-native-maps fail with wrong version

Making first steps with React Native. Trying to just get a map show in the simulator. Fails with :

React native version mismatch

JavaScript version 0.54.4

Native version 0.55.2

I am following the examples as they are found on react-native.com and the react-native-maps

create-react-native-app MyMap
cd MyMap
npm install react-native-maps --save
vi App.js

add import MapView from 'react-native-maps';

add

<MapView
    initialRegion={{
      latitude: 37.78825,
      longitude: -122.4324,
      latitudeDelta: 0.0922,
      longitudeDelta: 0.0421,
    }}
  />

npm run ios

fails with the above error in the simulator. In the terminal it tells me that maps require react-native 0.52 - 0.54 whereas the most recent version that came with the default install is 0.55 .

ps. Running a fresh OSX 10.13.4 Parallels-VM for development. Not sure if that's an issue? pps. Running the app without the maps edit works fine.

Try installing your project with older react-native version.

react-native init --version="0.54.0" MyMap

this might help:

New React Native project with old version of react native

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM