0

更新到 React Native 后0.60,标头链接不再起作用。

React library在构建期间链接时遇到问题:

/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>
        ^~~~~~~~~~~~~~~~~~~~~~~~

发生了什么变化0.60

  • 该文件RCTImageLoader.h现在位于/node_modules/react-native/React/CoreModules.
  • 包含这些标头的文件React.xcodeproj不再存在

反应本机文件夹

4

2 回答 2

2

It took me 3 hours. Finally I found the solution:

Use specific version 1.1.0 by running the command:

npm install react-native-image-resizer@1.1.0  

Then run the command:

cd ios && pod install 
于 2020-10-15T07:50:38.450 回答
1

React Native 0.60有很多变化,其中一个主要变化是 React 模块现在使用 CocoaPods 打包,它取代了 header 链接。

我建议您在 0.60+ 中生成一个新项目并检查其项目结构(主要是Podfile. 您还可以使用升级助手查看更改的内容。

于 2020-03-04T20:42:06.747 回答