AirGoogleMaps dir must be added to your xCode project to support GoogleMaps on iOS RN48
Asked Answered
P

2

0

I installed react-native-maps in my project in Android works perfectly but in I always the error appears, compiles well but has an error when executing in ios:

console.error: "react-native-maps: AirGoogleMaps dir must be added to your xCode project to support GoogleMaps on iOS".

"dependencies": {

"react": "16.0.0-alpha.6",

"react-native": "0.48.4",

"react-native-maps": "^ 0.17.1",

... }
Prescribe answered 8/11, 2017 at 20:7 Comment(0)
B
5

I had faced this problem a week ago, and I solved it yesterday.
First of all, My file structure like below and my version totally same as you.

MyApp--- ios
       |
       - android
       |
       - js- node-modules
           |
           - index.js
           |
           - etc...


Maybe it is little different with you, but just a file structure.

  • I use pod to install react-native-maps and I never link with react-native. After you install react-native-maps, you can use iOS native map now. Make sure you already able to use iOS map after which I will take you through.

  • In your xcode project left sidebar click right and click Add files to "your project" and choose node_modules/react-native-maps/lib/ios/AirGoogleMap enter image description here

  • Go to your project => target => Build Setting => Header Search Paths and double click to add path $(SRCROOT)/../js/node_modules/react-native-maps/lib/ios(this is my file structure) and turn non-recursive to recursive.
    If your file structure is following official like react-native, you should add path like this$(SRCROOT)/../node_modules/react-native-maps/lib/ios.

That is done, I hope it will help you.

Blocking answered 17/11, 2017 at 4:20 Comment(1)
Thanks for your response, it helped me a lot. regardsPrescribe
D
0

Comment PROVIDER_GOOGLE and automatically react native maps will use iOS maps.

<MapView 
    style={styles.map}
   //provider={PROVIDER_GOOGLE}
 />
Dorene answered 10/1, 2020 at 16:1 Comment(2)
This answer made my day. Thanks buddyLeopoldoleor
wow!! its really picked up iOS maps.!!Kloof

© 2022 - 2024 — McMap. All rights reserved.