以下构建命令失败:CompileC BUILD FAILED

问题描述 投票:0回答:2

它正在工作,我刚刚重新启动了我的电脑(iMAC M1)和“噗”!

(我之前没有问题,我的应用程序可以运行。)

我给你我得到的:

CompileC /Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Build/Intermediates.noindex/ReactNativeMobile.build/Debug-iphonesimulator/ReactNativeMobile.build/Objects-normal/arm64/AppDelegate.o /Users/[USER]/Desktop/react-native-mobile/ios/ReactNativeMobile/AppDelegate.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'ReactNativeMobile' from project 'ReactNativeMobile')
    cd /Users/[USER]/Desktop/react-native-mobile/ios
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -ivfsstatcache /Users/[USER]/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator17.4-21E210-aa93b11c43e2d16681ac3fa171344f4f.sdkstatcache -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fno-color-diagnostics -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/[USER]/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -index-store-path /Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Index.noindex/DataStore @/Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Build/Intermediates.noindex/ReactNativeMobile.build/Debug-iphonesimulator/ReactNativeMobile.build/Objects-normal/arm64/af3fcb34312c57c0f52879cdce924b91-common-args.resp -MMD -MT dependencies -MF /Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Build/Intermediates.noindex/ReactNativeMobile.build/Debug-iphonesimulator/ReactNativeMobile.build/Objects-normal/arm64/AppDelegate.d --serialize-diagnostics /Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Build/Intermediates.noindex/ReactNativeMobile.build/Debug-iphonesimulator/ReactNativeMobile.build/Objects-normal/arm64/AppDelegate.dia -c /Users/[USER]/Desktop/react-native-mobile/ios/ReactNativeMobile/AppDelegate.mm -o /Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Build/Intermediates.noindex/ReactNativeMobile.build/Debug-iphonesimulator/ReactNativeMobile.build/Objects-normal/arm64/AppDelegate.o -index-unit-output-path /ReactNativeMobile.build/Debug-iphonesimulator/ReactNativeMobile.build/Objects-normal/arm64/AppDelegate.o
In file included from /Users/[USER]/Desktop/react-native-mobile/ios/ReactNativeMobile/AppDelegate.mm:1:
/Users/[USER]/Desktop/react-native-mobile/ios/ReactNativeMobile/AppDelegate.h:1:9: fatal error: 'RCTAppDelegate.h' file not found
#import <RCTAppDelegate.h>
        ^~~~~~~~~~~~~~~~~~
1 error generated.

CompileStoryboard /Users/[USER]/Desktop/react-native-mobile/ios/ReactNativeMobile/LaunchScreen.storyboard (in target 'ReactNativeMobile' from project 'ReactNativeMobile')
    cd /Users/[USER]/Desktop/react-native-mobile/ios
    /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module ReactNativeMobile --output-partial-info-plist /Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Build/Intermediates.noindex/ReactNativeMobile.build/Debug-iphonesimulator/ReactNativeMobile.build/LaunchScreen-SBPartialInfo.plist --auto-activate-custom-fonts --target-device iphone --minimum-deployment-target 13.4 --output-format human-readable-text --compilation-directory /Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Build/Intermediates.noindex/ReactNativeMobile.build/Debug-iphonesimulator/ReactNativeMobile.build /Users/[USER]/Desktop/react-native-mobile/ios/ReactNativeMobile/LaunchScreen.storyboard

CompileAssetCatalog /Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Build/Products/Debug-iphonesimulator/ReactNativeMobile.app /Users/[USER]/Desktop/react-native-mobile/ios/ReactNativeMobile/Images.xcassets (in target 'ReactNativeMobile' from project 'ReactNativeMobile')
    cd /Users/[USER]/Desktop/react-native-mobile/ios
    /Applications/Xcode.app/Contents/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Build/Intermediates.noindex/ReactNativeMobile.build/Debug-iphonesimulator/ReactNativeMobile.build/assetcatalog_dependencies --output-partial-info-plist /Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Build/Intermediates.noindex/ReactNativeMobile.build/Debug-iphonesimulator/ReactNativeMobile.build/assetcatalog_generated_info.plist --app-icon AppIcon --compress-pngs --enable-on-demand-resources YES --filter-for-thinning-device-configuration iPhone16,2 --filter-for-device-os-version 17.2 --development-region en --target-device iphone --minimum-deployment-target 13.4 --platform iphonesimulator --compile /Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Build/Products/Debug-iphonesimulator/ReactNativeMobile.app /Users/[USER]/Desktop/react-native-mobile/ios/ReactNativeMobile/Images.xcassets


--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:10488651-8275-4D12-A891-0BC37CE8F11F, OS:17.2, name:iPhone 15 Pro Max }
{ platform:iOS Simulator, id:10488651-8275-4D12-A891-0BC37CE8F11F, OS:17.2, name:iPhone 15 Pro Max }
** BUILD FAILED **


The following build commands failed:
    CompileC /Users/[USER]/Library/Developer/Xcode/DerivedData/ReactNativeMobile-dzwwympbnncmhxbpmvkfeqqwcchk/Build/Intermediates.noindex/ReactNativeMobile.build/Debug-iphonesimulator/ReactNativeMobile.build/Objects-normal/arm64/AppDelegate.o /Users/[USER]/Desktop/react-native-mobile/ios/ReactNativeMobile/AppDelegate.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'ReactNativeMobile' from project 'ReactNativeMobile')
(1 failure)
]

Node.js v20.9.0

我不知道发生了什么,我的电脑肯定有问题。

我可以说:

  • 项目文件夹没有空间。
  • 我删除了Xcode的缓存和索引。
  • 在 Google 上查找并询问 Chat GPT。
  • 我删除了
    node_modules
    文件夹、
    package-lock.json
    文件并清理节点缓存,然后
    npm install
  • 再次重新启动我的电脑(也许......)
  • 我尝试不使用 Flipper,也许我没有做到这一点,但我遇到了下一个错误。
  • 我从头开始一个新项目,同样的问题。
  • 我也尝试过这个:如何修复 cocoapod .modulemap 文件未找到

我的命令:

npm run ios -- --simulator="iPhone 15 Pro Max (17.2)"
我的 ReactNative 版本:
"react-native": "0.73.2"
我的宝石文件:

source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

gem 'cocoapods', '1.15.0'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'

如果我使用

nom run iOS
,我收到此错误:

info A dev server is already running for this project on port 8081.
info Found Xcode workspace "ReactNativeMobile.xcworkspace"
info Found booted iPhone, iPhone 15 Pro Max
info Building (using "xcodebuild -workspace ReactNativeMobile.xcworkspace -configuration Debug -scheme ReactNativeMobile -destination id=00008020-001138E81178002E")

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 '70'. To debug build logs further, consider building your app with Xcode.app, by opening 'ReactNativeMobile.xcworkspace'.
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace ReactNativeMobile.xcworkspace -configuration Debug -scheme ReactNativeMobile -destination id=00008020-001138E81178002E

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES


2024-03-08 19:25:58.943 xcodebuild[5166:64572] Writing error result bundle to /var/folders/ff/8z0rnxqx6k9c6b_cvwb296wm0000gn/T/ResultBundle_2024-08-03_19-25-0058.xcresult
xcodebuild: error: Timed out waiting for all destinations matching the provided destination specifier to become available


    Available destinations for the "ReactNativeMobile" scheme:
        { platform:iOS, arch:arm64, id:00008020-001138E81178002E, name:iPhone, error:iPhone needs to be prepared for development Development services need to be enabled. Ensure that the device is unlocked. }

所以,我没有更多的想法了...

ios xcode react-native rubygems
2个回答
2
投票

我有同样的问题,但是 gem 文件略有不同:

source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

也许他们在我的 gem 文件的评论中谈论的错误就是影响你的错误..可能值得一试:)


0
投票

那么您解决了上述错误吗?

© www.soinside.com 2019 - 2024. All rights reserved.