【问题标题】:React Native, Invariant Violation: Native component for "AIRMap" does not existReact Native,Invariant Violation:“AIRMap”的本机组件不存在
【发布时间】:2018-09-16 07:47:34
【问题描述】:

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

我的安装过程如下。

我使用 react-native 链接而不是 cocoaPod。

  • npm i react-native-maps --save
  • myProj.xcodeproj/Libraries => 将文件添加到“myProj”点击
  • 添加 myProj/node_modules/react-native-maps/lib/ios/AirMaps.xcodeproj
  • myProj 单击 => 构建阶段,将二进制文件与库链接 => 添加 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 目标-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】:

    喜欢这个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

    【讨论】:

    • 感谢您的回复,但还是不行。我猜它无法导入 googlemap #import 生成 1 个错误。
    猜你喜欢
    • 1970-01-01
    • 2020-11-20
    • 2018-03-26
    • 1970-01-01
    • 1970-01-01
    • 2017-09-16
    • 2018-05-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多