React-native 0.57 ios limit文件未找到无法构建模块CoreFoundation

前端之家收集整理的这篇文章主要介绍了React-native 0.57 ios limit文件未找到无法构建模块CoreFoundation前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
RN 0.57.1

RN-cli 2.0.1

xCode:9.4.1(9F2000)或xCode 10

在RN从0.56更新到0.57.0(或0.57.1​​)后,我得到了很多无法构建模块’CoreFoundation’或无法构建模块基础或限制文件未找到

我完全按照RN doc的步骤进行了此更新.

我尝试删除ios / build文件夹,清理缓存,重新安装一切,但没有任何工作.

▸ Building BunteMobile/OneSignalNotificationServiceExtension [Debug] ▸
Check Dependencies ▸ Compiling NotificationService.m

/Users/myuser/Desktop/projects/mobileapp/ios/../node_modules/react-native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10:
‘limits’ file not found

@H_404_19@#include <limits>

/Users/myuser/Desktop/projects/mobileapp/ios/../node_modules/react-native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10:
‘limits’ file not found

@H_404_19@#include <limits>

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10:
could not build module ‘CoreFoundation’

@H_404_19@#include <CoreFoundation/CoreFoundation.h>

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:28:10:
could not build module ‘CoreFoundation’

@H_404_19@#include <CoreFoundation/CFBase.h>

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h:18:10:
could not build module ‘CoreFoundation’

@H_404_19@#include <CoreFoundation/CoreFoundation.h>

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/NSString+UserNotifications.h:8:9:
could not build module ‘Foundation’

@H_404_19@#import <Foundation/Foundation.h>

如果我删除OneSignalNotificationServiceExtension而不是7
错误我在项目的其他部分得到另外15个错误

/Users/myuser/Desktop/projects/mobileapp/ios/../node_modules/react-native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10:
‘limits’ file not found

@H_404_19@#include <limits>

/Users/myuser/Desktop/projects/mobileapp/ios/../node_modules/react-native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10:
‘limits’ file not found

@H_404_19@#include <limits>

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10:
could not build module ‘CoreFoundation’

@H_404_19@#include <CoreFoundation/CoreFoundation.h>

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:28:10:
could not build module ‘CoreFoundation’

@H_404_19@#include <CoreFoundation/CFBase.h>

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h:18:10:
could not build module ‘CoreFoundation’

@H_404_19@#include <CoreFoundation/CoreFoundation.h>

/Users/myuser/Desktop/projects/mobileapp/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h:8:9:
could not build module ‘Foundation’

@H_404_19@#import <Foundation/Foundation.h>

我找到的唯一解决方法是将RN降级回0.56 ……

根据RN团队的回答
https://github.com/facebook/react-native/issues/21482

将所有babel deps更改为7应该可以解决问题,但即使在npx babel-ugrade -w和重新安装的节点模块缓存清理后,我也会遇到相同的错误.

但仍然是同样的问题.

更新到0.57后,是否应在extension / ios构建设置中更新任何带有标题搜索路径的文件

我在这个IOS建设问题上花了3天时间….

注意:我能够在RN和babel升级后构建android.

React-native git关联票证:
https://github.com/facebook/react-native/issues/21482

要修复所有这些错误,我必须从项目标题搜索路径和OneSignalNotificationServiceExtension目标标题搜索路径中删除React和ReactCommon.

1)从项目标题搜索路径中删除

崩溃与限制,CoreFoundation,Foundation和CoreGraphics有关.

我去了Project Header Search Paths并从那里删除了React和ReactCommon依赖项.

这就是我的项目标题搜索路径现在的样子:

2)从单信号分机上删除:(可选,如果你没有任何分机,你不必这样做)

这是崩溃时用于查看的扩展路径的方式:

这就是该扩展的目标现在的样子:

注意:我没有更改项目目标标题搜索路径中的任何内容.

我不确定在RN 0.57中发生了什么变化,为什么它现在在0.57中崩溃,这个标题搜索路径应该如何在扩展,项目和目标中.为什么以前有React和ReactCommon工作,为什么现在它不再工作了.

我的项目是在3年前创建的,并且有许多RN更新.在某些时候,项目标题搜索路径中可能需要React和ReactCommon.

正如我在我的问题中所写,这个问题也在RN github中发出信号,
更多详情可在这找到:

https://github.com/facebook/react-native/issues/21482#issuecomment-427815231

原文链接:https://www.f2er.com/react/300828.html

猜你在找的React相关文章