React Native 0.40.0:RCTBundleURLProvider.h“找不到文件 - AppDelegate.m [英] React Native 0.40.0 : RCTBundleURLProvider.h” file not found - AppDelegate.m

查看:315
本文介绍了React Native 0.40.0:RCTBundleURLProvider.h“找不到文件 - AppDelegate.m的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的反应原生版本0.40.0版本React / RCTBundleURLProvider.h'找不到文件时出现以下错误。

I am getting following error with react native version 0.40.0 version React/RCTBundleURLProvider.h' file not found.

我尝试删除节点模块,安装它npm安装和清除watchman.multiple次。但仍无法使其正常工作。

I tried deleting node modules , installing it with npm install and clearing watchman.multiple times. But still not able to get it working.

推荐答案

从React Native 0.40开始(参见发行说明),iOS上的本机代码必须引用react命名空间之外的标头。以前可以使用以下方法:

As of React Native 0.40 (see release notes), native code on iOS must refer to headers out of the react namespace. Previously the following would work:

#import "RCTBundleURLProvider.h"

但现在所有标题都被移动了:

But now all headers have been moved:

#import <React/RCTBundleURLProvider.h>

如果要更新现有项目,则需要

If you are updating an existing project, you need to either


  • 运行 react-native upgrade 并手动合并这些更改,

  • 使用新的 react-native-git-upgrade 工具,或

  • 手动将所有标题导入更改为新格式。

  • run react-native upgrade and merge these changes manually,
  • use the new react-native-git-upgrade tool, or
  • manually change all header imports to the new format.

这篇关于React Native 0.40.0:RCTBundleURLProvider.h“找不到文件 - AppDelegate.m的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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