代码之家  ›  专栏  ›  技术社区  ›  Florin Dobre

未找到React本机0.57 ios限制文件无法生成模块CoreFoundation

  •  8
  • Florin Dobre  · 技术社区  · 6 年前

    RN cli 2.0.1版

    代码:9.4.1(9F2000) 代码10

    在将RN从0.56更新到0.57.0(或0.57.1)之后,我得到了很多 could not build module 'CoreFoundation' could not build module Foundation limits file not found

    我完全按照RN doc中的步骤进行更新。

    我试着搬走了 ios/build

    正在生成BunteMobile/OneSignalNotificationServiceExtension[调试] 检查NotificationService.m的依赖关系

    /Users/myuser/Desktop/projects/mobileapp/ios/./node\u modules/react native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10: 找不到“limits”文件

    #include <limits>

    /Users/myuser/Desktop/projects/mobileapp/ios/./node\u modules/react native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10:

    #包括<限制>

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: 无法生成模块“CoreFoundation”

    #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:

    #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: 无法生成模块“CoreFoundation”

    #包括<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: 无法生成模块“Foundation”

    #import <Foundation/Foundation.h>

    如果我删除OneSignalNotificationServiceExtension而不是7 错误我在项目的其他部分还有15个错误:

    /Users/myuser/Desktop/projects/mobileapp/ios/./node\u modules/react native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10: 找不到“limits”文件

    #包括<限制>

    /Users/myuser/Desktop/projects/mobileapp/ios/./node\u modules/react native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10: 找不到“limits”文件

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: 无法生成模块“CoreFoundation”

    #包括<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: 无法生成模块“CoreFoundation”

    #包括<核心基金会/CFBase.h>

    无法生成模块“CoreFoundation”

    /Users/myuser/Desktop/projects/mobileapp/ios/build/build/Products/Debug iphonesimulator/include/React/RCTBridgeModule.h:8:9: 无法生成模块“Foundation”

    #导入<基金会/基金会。h>

    唯一的解决办法,我发现是降低雷诺数回到0.56。。。

    根据注册护士小组的回答 https://github.com/facebook/react-native/issues/21482

    将所有babel deps改为7应该可以解决这个问题,但即使在 npx babel-ugrade -w 和重新安装的节点模块+缓存清理我得到同样的错误。

    但还是有同样的问题。

    我花了三天时间来解决这个IOS构建问题。。。。

    注意:在升级了RN和babel之后,我就可以构建android了。

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

    1 回复  |  直到 6 年前
        1
  •  7
  •   Florin Dobre    6 年前

    为了修复所有这些错误,我不得不删除 反应 Project Header Search paths OneSignalNotificationServiceExtension target header search paths .

    车祸与 limits , CoreFoundation , Foundation CoreGraphics .

    Project Header Search Paths 并从中删除了React和ReactCommon依赖项。

    project header search paths 现在看来: enter image description here

    (可选,如果您没有任何扩展,则不必执行此操作)

    崩溃时,该扩展的路径通常是这样的: enter image description here

    enter image description here

    注意:我没有改变任何东西 project target header search paths .

    header search paths

    更多详情请参见:

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