gpt4 book ai didi

swift - 在 M1 Macbook 上 React Native 运行 iOS 的构建错误

转载 作者:行者123 更新时间:2023-12-03 20:42:21 28 4
gpt4 key购买 nike

我第一次在我的 M1 Silicon Apple 计算机上使用“react-native init ReactNStudy”初始化了新的 react-native 项目。
地铁 build 者工作没有任何问题。
在构建步骤时,我收到非常日志错误。像这样开始部分错误:

info Found Xcode workspace "ReactNCalisma.xcworkspace" info Launching iPhone 12 (iOS 14.4) info Building (using "xcodebuild -workspace ReactNCalisma.xcworkspace -configuration Debug -scheme ReactNCalisma
-destination id=E914C899-172A-45AE-AFB6-BEBA505887E1") (node:25639) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use `node --trace-warnings ...` to show where the warning was created) error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening ReactNCalisma.xcworkspace. Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace ReactNCalisma.xcworkspace -configuration Debug -scheme ReactNCalisma -destination id=E914C899-172A-45AE-AFB6-BEBA505887E1
并像这样结束部分错误:
objc[25723]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1fc2be7a0) and ?? (0x1189b42b8). One of the two will be used. Which one is undefined.
objc[25723]: Class AMSupportURLSession is implemented in both ?? (0x1fc2be7f0) and ?? (0x1189b4308). One of the two will be used. Which one is undefined.
** BUILD FAILED **


The following build commands failed:
Ld /Users/USERNAME/Library/Developer/Xcode/DerivedData/ReactNCalisma-anxlznepgpgzoyfpokskqpwmffzt/Build/Products/Debug-iphonesimulator/ReactNCalisma.app/ReactNCalisma normal
(1 failure)

info Run CLI with --verbose flag for more details.
之后,我尝试使用“xcodebuild”运行:

cd ios && xcodebuild


但在这部分我得到错误为:
fatal error: module map file
'/Users/USERNAME/Desktop/Projects/ReactNCalisma/ios/build/Release-iphoneos/YogaKit/YogaKit.modulemap'
not found

** BUILD FAILED **
The following build commands failed:
CompileC /Users/USERNAME/Desktop/Projects/ReactNCalisma/ios/build/ReactNCalisma.build/Release-iphoneos/ReactNCalisma.build/Objects-normal/arm64/ReactNCalisma_vers.o /Users/USERNAME/Desktop/Projects/ReactNCalisma/ios/build/ReactNCalisma.build/Release-iphoneos/ReactNCalisma.build/DerivedSources/ReactNCalisma_vers.c normal arm64 c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/USERNAME/Desktop/Projects/ReactNCalisma/ios/build/ReactNCalisma.build/Release-iphoneos/ReactNCalisma.build/Objects-normal/armv7/ReactNCalisma_vers.o /Users/USERNAME/Desktop/Projects/ReactNCalisma/ios/build/ReactNCalisma.build/Release-iphoneos/ReactNCalisma.build/DerivedSources/ReactNCalisma_vers.c normal armv7 c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
我试图用 Pod 删除并重新安装来解决,我检查了我的 Xcode 终端设置,但我无法解决这个问题。
这是M1的问题吗?我该如何解决这个问题?

最佳答案

我在 macbook M1 上遵循了这些步骤(cocoapoda 和构建的问题):
1- 使用带有 Rosetta 的终端(确保所有终端都已关闭):
转到 Finder --> Applications --> Utilities --> Terminal(然后右键单击获取信息 - 选中使用 Rosetta 打开)
现在您可以打开终端并从终端安装 Cocoapoda
2- 将 Xcode 与 Rosetta 一起使用(确保 Xcode 已关闭):
Go Finder --> Application --> Xcode(然后右键单击“获取信息”-选中“使用 Rosetta 打开”)
现在 Xcode/模拟器将作为 Rosetta 工作
3- 在 Podfile 中评论这部分(在 ios 文件夹中)

# use_flipper!
# post_install do |installer|
# flipper_post_install(installer)
# end
然后重新安装pod:
cd ios/
$ rm -rf build/
$ pod install
检查这个视频:
https://youtu.be/UrxM1SyAXAE

关于swift - 在 M1 Macbook 上 React Native 运行 iOS 的构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66612257/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com