响应本机,不变的违规行为:“ AIRMap”的本机组件不存在

时间:2018-09-16 07:47:35

标签: google-maps react-native react-native-ios

我正在尝试安装react-native-maps 我按照文档进行安装。

我的安装过程如下。

我使用react-native链接代替了cocoaPod。

  • npm我react-native-maps-保存
  • myProj.xcodeproj / Libraries =>将文件添加到“ myProj”单击
  • 添加myProj / node_modules / react-native-maps / lib / ios / AirMaps.xcodeproj
  • myProj单击=>构建阶段,使用库链接二进制文件=>添加libArMaps.a
  • 本机链接react-native-maps

但是,构建失败。

  

**生成失败**

     

以下构建命令失败:

     

CompileC /Users/dadumvu/work/foodup-mobile-RN/ios/build/Build/Intermediates.noindex/AirMaps.build/Debug-iphonesimulator/AirMaps.build/Objects-normal/x86_64/AIRGoogleMapPolygonManager.o AirGoogleMaps / AIRGoogleMapPolygonManager.m正常x86_64 Objective-c com.apple.compilers.llvm.clang.1_0.compiler   (1次失败)

我的版本在这里。

"react-native-maps": "^0.21.0"

"react-native": "0.55.4"

如果任何人都可以解决此问题,请告诉我。 谢谢。

1 个答案:

答案 0 :(得分:1)

How to fix"AIRMap" was not found in the UIManager error in react native?

添加到ios/YOUR_PROJECT_NAME/AppDelegate.m

@import GoogleMaps; //add this line if you want to use Google Maps

[GMSServices provideAPIKey:@"_YOUR_API_KEY_"]; // add this line using the api key obtained from Google Console

相关问题