ios – React Native Build Error:无法读取优化配置文件(即使在更改优化配置之后)

ios – React Native Build Error:无法读取优化配置文件(即使在更改优化配置之后),第1张

概述我试图用这个 video中的步骤来解决一些配置问题,之后构建过程会报告错误. 该视频中的步骤如下: 1.项目 – >清洁 2.项目 – >建立 3.项目 – >执行 *** 作 – >生成优化文件 4.启用Optimazation   它确实帮助我在连接的设备上运行应用程序.但在此之后,构建过程始终失败,并显示以下错误消息: 无法读取配置文件[我的项目文件夹] /node_modules/react-na 我试图用这个 video中的步骤来解决一些配置问题,之后构建过程会报告错误.

该视频中的步骤如下:

1.项目 – >清洁
2.项目 – >建立
3.项目 – >执行 *** 作 – >生成优化文件
4.启用Optimazation
 

它确实帮助我在连接的设备上运行应用程序.但在此之后,构建过程始终失败,并显示以下错误消息:

无法读取配置文件[我的项目文件夹] /node_modules/react-native/React/OptimizationProfiles/React.profdata:没有这样的文件或目录

在环顾SO几个小时后,我尝试了以下不同的方法,但没有一个工作:
1)

Go to Project -> Build Setting -> Apple LLVM 9.2-code generation  clear Optimization Profile file // clear is removing the value to empty,correct?  Clean project and build again

所有目标的优化级别均为无:


source here

>手动将优化配置文件的路径设置为另一个位置(没有生成的profdata文件,这是另一个错误,但它在连接的设备上运行应用程序)
>按照answers to this question中的建议删除DerivedData文件夹
>删除Build文件夹
>清除Xcode首选项并重新安装Xcode

每当我构建它仍然试图在/node_modules/react-native/React/OptimizationProfiles/React.profdata中找到文件.使用react-native run-ios时的结果相同.它是某种缓存吗?(虽然我删除了DerivedData文件夹,构建文件夹,并清理了项目).这里是更多错误信息的信息:

CompileC `MyProjectFolder`/ios/build/Build/Intermediates.noindex/React.build/DeBUG-iphonesimulator/yoga.build/Objects-normal/x86_64/YGNodeList.o `MyProjectFolder`/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compilercd /Users/'ausername'/documents/dev_fs/RecycleWizard/node_modules/react-native/Reactexport LANG=en_US.US-ASCIIexport PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhonesimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/`SomeUsername`/anaconda/bin:/Users/'SomeUsername'/documents/apache-maven-3.0.5/bin:/usr/local/heroku/bin:./node_modules/.bin:/Users/'SomeUsername'/.rvm/gems/ruby-2.0.0-p451/bin:/Users/'SomeUsername'/.rvm/gems/ruby-2.0.0-p451@global/bin:/Users/'SomeUsername'/.rvm/rubIEs/ruby-2.0.0-p451/bin:/library/JAVA/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/`SomeUsername`/.rvm/bin:/Users/`SomeUsername`/.rvm/bin"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fmodules -fmodules-cache-path=`MyProjectFolder`/ios/build/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=`MyProjectFolder`/ios/build/ModuleCache/Session.modulevalIDation -fmodules-valIDate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-fIEld-initializers -Wmissing-prototypes -Werror=return-type -Wunreachable-code -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unkNown-pragmas -Wshadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wnewline-eof -DDEBUG=1 -DRCT_DEBUG=1 -DRCT_DEV=1 -DRCT_NSASSERT=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhonesimulator.platform/Developer/SDKs/iPhonesimulator11.2.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -mios-simulator-version-min=8.0 -g -Wno-sign-conversion -Winfinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -fprofile-instr-use=`MyProjectFolder`/node_modules/react-native/React/OptimizationProfiles/React.profdata -index-store-path `MyProjectFolder`/ios/build/Index/DataStore -I`MyProjectFolder`/ios/build/Build/Intermediates.noindex/React.build/DeBUG-iphonesimulator/yoga.build/yoga.hmap -I`MyProjectFolder`/ios/build/Build/Products/DeBUG-iphonesimulator/include -I`MyProjectFolder`/ios/build/Build/Intermediates.noindex/React.build/DeBUG-iphonesimulator/yoga.build/DerivedSources/x86_64 -I`MyProjectFolder`/ios/build/Build/Intermediates.noindex/React.build/DeBUG-iphonesimulator/yoga.build/DerivedSources -Wextra -Wall -Wno-semicolon-before-method-body -F`MyProjectFolder`/ios/build/Build/Products/DeBUG-iphonesimulator -MMD -MT dependencIEs -MF `MyProjectFolder`/ios/build/Build/Intermediates.noindex/React.build/DeBUG-iphonesimulator/yoga.build/Objects-normal/x86_64/YGNodeList.d --serialize-diagnostics `MyProjectFolder`/ios/build/Build/Intermediates.noindex/React.build/DeBUG-iphonesimulator/yoga.build/Objects-normal/x86_64/YGNodeList.dia -c `MyProjectFolder`/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c -o `MyProjectFolder`/build/Build/Intermediates.noindex/React.build/DeBUG-iphonesimulator/yoga.build/Objects-normal/x86_64/YGNodeList.o

尝试其他方法的想法?谢谢

解决方法 找到一个解决方案(但它需要一定程度的重复设置工作),如果你遇到同样的问题并且问题中列出的方法都没有工作,你可以试试这个(作为最后的手段):

反应原生run-ios因以下错误而失败后,我查看了登录终端:

Error: Command Failed: /usr/libexec/PListBuddy -c Print:CFBundleIDentifIEr build/Build/Products/DeBUG-iphonesimulator/SomeProject.app/Info.pListPrint: Entry,":CFBundleIDentifIEr",Does Not Exist

正如建议here,react-native升级(react-native版本是0.47.2),为了确保清除所有缓存,我也按照this thread中的提到做了这个:

watchman watch-del-allrm -rf $TMPDIR/react-*rm -rf yarn.lockrm -rf ./node_modulesyarn install

完成这些步骤之后,剩下的就是基本上再次设置项目,我确实对本机链接和所有其他配置做出反应本机插件(例如update info.pList).但该项目可以在之后成功构建.

我不确定它是否是Xcode或RN中的错误(在我使用执行 *** 作之后 – >生成优化文件)它不断尝试找到文件/node_modules/react-native/React/OptimizationProfiles/React.profdata这很奇怪.

希望这可以帮助.

总结

以上是内存溢出为你收集整理的ios – React Native Build Error:无法读取优化配置文件(即使在更改优化配置之后)全部内容,希望文章能够帮你解决ios – React Native Build Error:无法读取优化配置文件(即使在更改优化配置之后)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1048916.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存