vem*_*und 8 javascript reactjs react-native react-native-maps
可能是有人在问这个问题,我一直在Github上找,但是找不到适合安装React Native Maps的解决方案...
不变违规:requireNativeComponent:在UIManager中找不到“ AIRMap”。
此错误位于AIRMap中(位于MapView.js:760)和MapView中(位于Home.js:118)。
"react-native": "^0.57.0-rc.4",
"react-native-maps": "^0.21.0",
Run Code Online (Sandbox Code Playgroud)
我试过了:
rm -rf ios android node_modules
npm install
react-native upgrade
react-native link
libAirMaps.a is added in Build Phases
AirGoogleMaps and AirMaps is added to Libraries
Run Code Online (Sandbox Code Playgroud)
遵循本指南,以在不使用CocoaPods的情况下手动添加iOS版Maps SDK:https://developers.google.com/maps/documentation/ios-sdk/start
新增@import GoogleMaps;
和[GMSServices provideAPIKey:@"_YOUR_API_KEY_"];
到AppDelegate.m
仍然出现相同的错误...
我尚未将其添加到package.json中,因为我不确定它要求的路径是什么?我在https://github.com/react-community/react-native-maps/blob/master/docs/installation.md找到了
{
"name": "your-app",
"scripts": {
"postinstall": "./node_modules/react-native-maps/enable-google-maps REPLACE_ME_RELATIVE_PATH_TO_GOOGLE_MAPS_INSTALL"
}
}
Run Code Online (Sandbox Code Playgroud)
如果您按照 Google Map doc 手动安装 SDK,您可能已经将这三个框架添加到您的项目中,只需在 Xcode 中右键单击该框架,然后在 Finder 中显示,您就可以在 Finder 中找到该框架文件
在我的例子中,REPLACE_ME_RELATIVE_PATH_TO_GOOGLE_MAPS_INSTALL
指的是我的ios目录,相关路径是./ios
,只需将其添加到package.json
文件中并运行
npm install
{
"name": "your-app",
"scripts": {
"postinstall": "./node_modules/react-native-maps/enable-google-maps ./ios"
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1451 次 |
最近记录: |