最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - AirGoogleMaps dir must be added to your xCode project to support GoogleMaps on iOS RN48 - Stack Overflow

programmeradmin0浏览0评论

I installed react-native-maps in my project in Android works perfectly but in I always the error appears, piles 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",

... }

I installed react-native-maps in my project in Android works perfectly but in I always the error appears, piles 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",

... }
Share Improve this question edited Jan 22, 2019 at 7:13 Cœur 38.8k25 gold badges206 silver badges278 bronze badges asked Nov 8, 2017 at 20:07 sebastian gamboasebastian gamboa 592 silver badges10 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 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

  • 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.

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

<MapView 
    style={styles.map}
   //provider={PROVIDER_GOOGLE}
 />

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论