在 IOS 上的 React Native 上找不到 RCTConvert+AirMap.h 文件错误 [英] RCTConvert+AirMap.h file not found Error on React Native on IOS

查看:20
本文介绍了在 IOS 上的 React Native 上找不到 RCTConvert+AirMap.h 文件错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个错误.在 IOS 上的 React Native 上找不到 RCTConvert+AirMap.h 文件错误

解决方案

最新更新

对于类似或最新的配置

<预><代码>反应":17.0.1",反应原生":0.64.2",react-native-cli":^2.0.1",react-native-maps":^0.28.0",

使用 GoogleMap 和其他地图提供程序配置 React Native Maps 要容易得多.

自动链接不能解决问题,因此您必须手动告诉 xcode 本地代码在哪里.有两种方法可以告诉

  1. 手动添加文件/文件夹到 Xcode 在此处使用这些说明
  2. 最简单的.无需转到 Xcode 来调整 header 搜索路径

2.最简单的

# Podfilepod 'react-native-google-maps', :path =>'../../../node_modules/react-native-maps/'pod 'react-native-maps', :path =>'../../../node_modules/react-native-maps/'# 这些可能不是必需的# 请在没有这些的情况下构建.如果无法构建,也添加这些豆荚谷歌地图"pod 'Google-Maps-iOS-Utils'

AppDelegate.m 文件中

#import //这一行已经存在.添加下面的行#import ......- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions//这一行已经存在.添加下面的行{+ [GMS服务提供APIKey:@AIzaEEBBLn-PhCDDD1AnC_h66yH8LEEUkd14WW0"];//使用从 Google Console 获取的 api 密钥添加此行

注意事项:

  1. AIzaEEBBLn-PhCDDD1AnC_h66yH8LEEUkd14WW0 替换为来自 Google 控制台的您自己的 API 密钥.
  2. 就我而言,我使用的是 monorepo 技术,所以 '../../../node_modules/react-native-maps/'.在你的情况下它的 '../node_modules/react-native-maps/'
  3. 应使用
  4. +- 符号.它们是语言定义的实体.没有类型错误

i have this Error . RCTConvert+AirMap.h file not found Error on React Native on IOS

解决方案

Latest Update

For config similar or latest


    "react": "17.0.1",
    "react-native": "0.64.2",
    "react-native-cli": "^2.0.1",
    "react-native-maps": "^0.28.0",

Its pretty much easier to configure React Native Maps using GoogleMap and other map providers.

Auto-linking does not solve the problem so you will have to manually tell xcode where the native code is. There are 2 ways to tell

  1. Manually add files/folders to Xcode using these instructions here
  2. The Simplest. No need to goto Xcode for tweaking header search path

2. Simplest

# Podfile

pod 'react-native-google-maps', :path => '../../../node_modules/react-native-maps/'
pod 'react-native-maps', :path => '../../../node_modules/react-native-maps/'

# These might not be necessary
# Please build without these. If could not build, add these as well
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils'

in AppDelegate.m file

#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h> // this line is alreaady there.  Add the line below
#import <GoogleMaps/GoogleMaps.h>

...

...

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions // this line is alreaady there.  Add the line below
{
+  [GMSServices provideAPIKey:@"AIzaEEBBLn-PhCDDD1AnC_h66yH8LEEUkd14WW0"]; // add this line using the api key obtained from Google Console

Notes:

  1. replace AIzaEEBBLn-PhCDDD1AnC_h66yH8LEEUkd14WW0 with your own API Key from google console.
  2. In my case I am using monorepo technique so '../../../node_modules/react-native-maps/'. In your case its '../node_modules/react-native-maps/'
  3. + and - sign should be used. They are language defined entities. No type error

这篇关于在 IOS 上的 React Native 上找不到 RCTConvert+AirMap.h 文件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆