Xcode Build Failure:“React Native Build Issues on iOS. Xcode Error Code 65 and AppDelegate.m错误”

qnakjoqk  于 5个月前  发布在  iOS
关注(0)|答案(1)|浏览(95)

上下文:

使用Mern Stack。
我有一个React Native项目是在2021年启动的。它曾经使用npm install,npx pod-install和npm run ios运行时没有问题。然而,自2023年5月以来,我遇到了多个错误和依赖问题,可能是由于Xcode或macOS更新。
在更新了项目的依赖项以解决最初的错误之后,我现在被一个我似乎无法解决的最终构建错误卡住了。通过Xcode运行项目(打开MYVU.xcworkspace)产生了一个不同的错误。下面是我目前面临的错误的详细信息。

错误:
**1. npm run ios上的终端错误:**在开始时,我收到了通常的构建过程日志,但它以以下内容结束:

“错误无法构建iOS项目。我们运行了“xcodebuild”命令,但它退出时显示错误代码65。要进一步调试构建日志,请考虑使用Xcode.app构建您的应用,方法是打开MYVU. xcworkspace。“
具体的构建命令失败是:“以下构建命令失败:C/Users/bolt/Library/Developer/Xcode/DerivedData/MYVU-azqcqluibbqvqnguxonkqyoewstd/Build/Intermediates.noindex/Pods.build/RCT-Folly.build/Objects-normal/x86_64/SysUio. o/Users/bolt/Desktop/myvu-mobile-main/ios/Pods/RCT-Folly/portability/SysUio.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler(在项目“Pods”的目标“RCT-Folly”中)(1次失败)”The specific build command failure is:

**2. AppDelegate.m中的Xcode错误:**直接从Xcode(MYVU.xcworkspace)运行项目时,在AppDelegate.m中遇到此错误:

"No visible @interface for 'RCTBundleURLProvider' declares the selector 'jsBundleURLForBundleRoot:fallbackResource:'"

环境:

React Native版本:18.2.0 Xcode版本:15.0.1 macOS版本:索诺马14.1.1 Node版本:v21.1.0

尝试解决:

已将项目依赖关系更新为最新版本。已清理构建文件夹并删除Xcode中的派生数据。已尝试重置iOS模拟器。已搜索类似问题,但找不到适合的解决方案。

预期:

模拟器应打开并构建应用程序。

3zwjbxry

3zwjbxry1#

除该职位外:
Android构建没有问题,但对于iOS构建,我看到了类似的东西:
npm运行ios

> [email protected] ios
> react-native run-ios

info A dev server is already running for this project on port 8081.
info Found Xcode workspace "AwesomeProject.xcworkspace"
info Found booted iPhone 15
info Building (using "xcodebuild -workspace AwesomeProject.xcworkspace -configuration Debug -scheme AwesomeProject -destination id=055DD7C2-843A-4686-8FA0-0A05DD0446C2")
▸ Running script '[CP-User] [Hermes] Replace Hermes for the right configuration, if needed'
▸ Running script '[CP-User] Generate Specs'
▸ Compiling react_native_log.cpp
▸ Compiling MapBuffer.cpp
▸ Compiling DebugStringConvertible.cpp
▸ Compiling InspectorInterfaces.cpp
▸ Compiling AssertFatal.cpp
▸ Compiling RunLoopObserver.cpp
▸ Compiling ManagedObjectWrapper.mm
▸ Compiling JSIDynamic.cpp
▸ Compiling JsErrorHandler.cpp
    Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'AwesomeProject' from project 'AwesomeProject')
    Run script build phase '[CP-User] [Hermes] Replace Hermes for the right configuration, if needed' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'hermes-engine' from project 'Pods')

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor 

error Failed to build iOS project. "xcodebuild" exited with error code '65'. To debug build logs further, consider building your app with Xcode.app, by opening 'AwesomeProject.xcworkspace'.

字符串
p.s. RN 0.72.8对我来说没有问题。

相关问题