【问题标题】:The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0 - React Native, VS CodeiOS 模拟器部署目标“IPHONEOS_DEPLOYMENT_TARGET”设置为 8.0 - React Native, VS Code
【发布时间】:2021-07-26 01:11:03
【问题描述】:

嘿 Stackoverflow 社区,

我对 React Native 完全陌生,并且已经在第一步中苦苦挣扎。我已经根据这个网站做了所有事情:https://reactnative.dev/docs/environment-setup

我已经安装了 node 和 watchman 我为模拟运行了 X 代码 我已经安装了可可豆荚 我用的编辑器是VS Code,终端是iTerm。

我创建了一个文档中描述的测试项目。

npx react-native init AwesomeProject

之后,我进入文件夹,在两个不同的终端中运行。

npx react-native start
npx react-native run-ios

当我在 Youtube 上看到人们这样做时,它总是有效,但我得到的是以下内容:

warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'boost-for-react-native' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'YogaKit' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.4, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-PeerTalk' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-Glog' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-DoubleConversion' from project 'Pods')
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the AwesomeProject editor. (in target 'AwesomeProject' from project 'AwesomeProject')

** BUILD FAILED **


The following build commands failed:
    CompileC /Users/mw/Library/Developer/Xcode/DerivedData/AwesomeProject-hdnnulyuswlwrafjfjkeikstoeak/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users/mw/Desktop/AwesomeProject/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

如果有人能帮我解决这个问题,我会非常高兴。我在 Stackoverflow 上看过其他一些帖子,但没有任何帮助。

非常感谢

更新

做了之后我就变了

cd AwesomeProject/ios
a) Comment this line in Podfile
   # use_flipper!()
b) pod install

随着运行:

npx react-native run-ios

我收到此错误消息:

    /bin/sh -c /Users/mw/Library/Developer/Xcode/DerivedData/AwesomeProject-hdnnulyuswlwrafjfjkeikstoeak/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-90F0FABA0342DD788075D851B9320B7C.sh
N/A: version "N/A -> N/A" is not yet installed.

You need to run "nvm install N/A" to install it before using it.
Command PhaseScriptExecution failed with a nonzero exit code

warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the AwesomeProject editor. (in target 'AwesomeProject' from project 'AwesomeProject')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'boost-for-react-native' from project 'Pods')

** BUILD FAILED **


The following build commands failed:
        PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/mw/Library/Developer/Xcode/DerivedData/AwesomeProject-hdnnulyuswlwrafjfjkeikstoeak/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-90F0FABA0342DD788075D851B9320B7C.sh
(1 failure)

在研究这个错误消息时,我发现它可能与 NodeJS 有关,但安装了 Node。

【问题讨论】:

标签: ios reactjs xcode macos react-native


【解决方案1】:

如果你使用nvm,尝试卸载nvm、node、npm、yarn,重新安装node

【讨论】:

    【解决方案2】:

    我在一个已经存在的项目中遇到了同样的问题。在这个项目中 Flipper 是必需的,所以在 Podfile 中将其注释掉并没有解决问题。

    这条评论带有一条取决于 React Native 版本的指令,帮助我让项目在 iOS 模拟器中重新运行:https://github.com/facebook/react-native/issues/31179#issuecomment-830184757

    【解决方案3】:

    你需要一个额外的步骤:

    1) npx react-native init AwesomeProject
    
    2) cd AwesomeProject/ios
       a) Comment this line in Podfile
          # use_flipper!()
       b) pod install
    
    3) cd ..
       npx react-native run-ios
    

    【讨论】:

    • 感谢您的超快答复。在我输入你告诉我的内容后,我收到了一条新的错误消息` `
    • 也许您可以在帖子中粘贴错误(以及针对哪个步骤)。
    • 是步骤 3 中的错误吗? pod install 运行正常吗?
    • 是的pod install给了我答案Pod installation complete! There are 30 dependencies from the Podfile and 29 total pods installed.
    • 会不会是使用VS Code造成的?
    猜你喜欢
    • 2021-02-24
    • 2021-10-13
    • 2020-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-08
    • 2021-12-01
    • 2019-09-07
    相关资源
    最近更新 更多