简体   繁体   English

为什么我不能再编译我的 React-native 应用程序?

[英]Why can't I compile my React-native apps anymore?

I'm gonna ask your guidance/help for a problem I've been encountering for several days now,我要寻求你的指导/帮助解决我几天来遇到的问题,

I can create a new react native project (via npx react-native init projectName), but when I try to run it, either with npx react-native run-ios or yarn ios, I get the following error message:我可以创建一个新的 React Native 项目(通过 npx react-native init projectName),但是当我尝试使用 npx react-native run-ios 或 yarn ios 运行它时,我收到以下错误消息:

The following build commands failed: CompileC /Users/user/Library/Developer/Xcode/DerivedData/Trickster-ejsutjhruuvmqjedsaarumhaquan/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/SysUio.o /Users/user/Dev/Mobile/React以下构建命令失败:CompileC /Users/user/Library/Developer/Xcode/DerivedData/Trickster-ejsutjhruuvmqjedsaarumhaquan/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/ SysUio.o /Users/user/Dev/Mobile/React
Native/Trickster/ios/Pods/RCT-Folly/folly/portability/SysUio.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods') Native/Trickster/ios/Pods/RCT-Folly/folly/portability/SysUio.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler(在项目“Pods”的目标“RCT-Folly”中)

I've already cleaned yarn/npm cache, cleaned Xcode's DerivedData folder, even uninstalled node and react native from my computer, so I'm kinda lost tbh.我已经清理了 yarn/npm 缓存,清理了 Xcode 的 DerivedData 文件夹,甚至从我的计算机上卸载了 node 和 react native,所以我有点迷路了。

Here are my specs: MacBook Pro Mid 2014 with a 2.6GHz Core i5, 8Gbs of ram running macOS Monterey 12.2.1 npm version 8.5.2, 1.22.17 and Xcode 13.2.1.这是我的规格:MacBook Pro Mid 2014,配备 2.6GHz Core i5、8Gbs 内存,运行 macOS Monterey 12.2.1 npm 版本 8.5.2、1.22.17 和 Xcode 13.2.1。

Sorry in advance if I don't answer fast, I'm a bit ill atm so kinda occupying my time till I'm better如果我没有快速回答,请提前道歉,我在 atm 有点不舒服,所以有点占用我的时间,直到我好起来

Try running Project from Xcode that will show you where problem exactly is尝试从 Xcode 运行项目,它会告诉你问题到底出在哪里

This problem can be for several reasons.此问题可能有多种原因。 To avoid going into so much explanation If the application worked at some point避免过多解释如果应用程序在某个时候工作

  1. Delete the app in the device and删除设备中的应用程序并
    run yarn android or npm android or运行yarn androidnpm android
  2. delete the build folder and delete the app in the device and删除构建文件夹并删除设备中的应用程序,然后
    run yarn android or npm android or运行yarn androidnpm android
  3. on Android delete and reinstall the device then在 Android 上删除并重新安装设备然后
    run yarn android or npm android运行yarn androidnpm android

That's works for me这对我有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM