React Native,Invariant Violation:“AIRMap”的本机组件不存在

问题描述 投票:3回答:1

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

我的安装过程如下所示。

I used react-native link instead of cocoaPod.

  • npm i react-native-maps --save
  • myProj.xcodeproj / Libraries =>将文件添加到“myProj”单击
  • 添加myProj / node_modules / react-native-maps / lib / ios / AirMaps.xcodeproj
  • myProj click => Build Phases,Link Binary with libraries => add libArMaps.a
  • react-native链接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"

如果有人能解决这个问题,请告诉我。谢谢。

google-maps react-native react-native-ios
1个回答
1
投票

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

Add to 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

© www.soinside.com 2019 - 2024. All rights reserved.