React Native: Unable to import React headers after updating to 0.60

空扰寡人 提交于 2020-03-12 06:00:20

问题


After updating to React Native 0.60 the header linking does no longer work.

I'm having problems linking from the React library during build:

/Users/User/Developer/Project/node_modules/react-native-image-resizer/ios/RCTImageResizer/RCTImageResizer.m:12:9: fatal error: 'React/RCTImageLoader.h' file not found
#import <React/RCTImageLoader.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~

What changed in 0.60:

  • The file RCTImageLoader.h is now at /node_modules/react-native/React/CoreModules.
  • The file React.xcodeproj that contained these headers is no longer present


回答1:


There were many changes in React Native 0.60, one of the main ones is that React modules are now packaged using CocoaPods, which replaces header linking.

I recommend you generate a new project in 0.60+ and check out its project structure (mainly the Podfile). You can also use the upgrade helper to see what's changed.



来源:https://stackoverflow.com/questions/60530791/react-native-unable-to-import-react-headers-after-updating-to-0-60

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!