我通过命令“npm i react-native-maps”安装谷歌地图模块。
在 AppDelegate.m(m) 中,在页面顶部添加“#import
Add "[GMSServices provideAPIKey:@"YOUR_API_KEY"];"在“(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {”之后
将部署目标更改为“13.0”
之后我添加
pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/Simon-TechForm/google-maps-ios-utils.git', :branch => 'feat/support-apple-silicon'
rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path
在“use_native_modules”上方的 Podfile 中 6. 然后运行“pod install”
我收到错误消息“CocoaPods 找不到 pod“react-native-google-maps”的兼容版本”
这里是一些截图
我正在尝试解决这个问题,但我做不到。