gpt4 book ai didi

ios - react-native-maps:必须将 AirGoogleMaps 目录添加到您的 xCode 项目以支持 iOS 上的 GoogleMaps

转载 作者:行者123 更新时间:2023-12-01 22:10:31 29 4
gpt4 key购买 nike

我尝试在 iOS 上使用谷歌地图,但出现此错误:

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

Error Image

我正在使用 react-native.maps https://github.com/react-community/react-native-maps

我按照安装说明进行操作,在 Android 中它运行良好,但在 IOS 中却不行

苹果操作系统:10.14.1 (18B75)

dependencies {

"react": "16.5.0",

"react-native": "0.57.1",

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

}

最佳答案

好的,我刚刚遇到了同样的问题,所以这是我解决它的方法:

首先在这里遵循这个答案:

https://github.com/react-community/react-native-maps/issues/693#issuecomment-262656417

然后你需要进入 xcode > build settings > Preprocessor Macros > add HAVE_GOOGLE_MAPS=1

P.S 在我使用的实际组件中

import MapView from "react-native-maps";

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

我的风格> map :{ 位置:“绝对”, 顶部:0, 左:0, 底部:0, 右:0

希望这有帮助;)

关于ios - react-native-maps:必须将 AirGoogleMaps 目录添加到您的 xCode 项目以支持 iOS 上的 GoogleMaps,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53436368/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com