0

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.

El Dude
  • 5,328
  • 11
  • 54
  • 101

1 Answers1

1

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

aravind_reddy
  • 5,236
  • 4
  • 23
  • 39
  • I do not have `react-native` in my path. Do I have to do `create-react-native-app MyMap` and run `react-native` there? Or install `sudo npm -g install react-native@0.54` ? – El Dude May 11 '18 at 13:29
  • 1
    just do `sudo npm install -g react-native-cli` and then `react-native init --version="0.54.0" MyMap` – aravind_reddy May 11 '18 at 13:39
  • Did it. Seems to work. Now I get "Native component for AirMap does not exist" . Running iOS simulator. Moving on. However, now I do not have the Expo tool when I do `react-native init`. – El Dude May 11 '18 at 13:44
  • yeah thats one draw back using init you dont get to Expo tool with it -_- – aravind_reddy May 11 '18 at 13:48