gpt4 book ai didi

xcode - React-native 0.60.4 xcode 构建失败

转载 作者:行者123 更新时间:2023-12-02 00:54:17 26 4
gpt4 key购买 nike

我使用 react-native 0.60.4 版本创建新项目。

在模拟器上运行 react-native run-ios 没问题。

但是使用Xcode构建项目会显示警告和错误。

我尝试 rm -rf node_modules && npm installpod install ,但构建失败并出现相同的错误消息。

Xcode 构建失败消息:

ld: warning: directory not found for option '-L/Users/username/Library/Developer/Xcode/DerivedData/test_rea-hdbyphuobutanveksnvnbgtevbhs/Build/Products/Debug-iphonesimulator/DoubleConversion' ld: warning: directory not found for option '-L/Users/username/Library/Developer/Xcode/DerivedData/test_rea-hdbyphuobutanveksnvnbgtevbhs/Build/Products/Debug-iphonesimulator/Folly' ld: warning: directory not found for option '-L/Users/username/Library/Developer/Xcode/DerivedData/test_rea-hdbyphuobutanveksnvnbgtevbhs/Build/Products/Debug-iphonesimulator/React-Core' ld: warning: directory not found for option '-L/Users/username/Library/Developer/Xcode/DerivedData/test_rea-hdbyphuobutanveksnvnbgtevbhs/Build/Products/Debug-iphonesimulator/React-DevSupport' ld: warning: directory not found for option '-L/Users/username/Library/Developer/Xcode/DerivedData/test_rea-hdbyphuobutanveksnvnbgtevbhs/Build/Products/Debug-iphonesimulator/React-RCTActionSheet' ld: warning: directory not found for option '-L/Users/username/Library/Developer/Xcode/DerivedData/test_rea-hdbyphuobutanveksnvnbgtevbhs/Build/Products/Debug-iphonesimulator/React-RCTAnimation' ..............

ld: library not found for -lDoubleConversion clang: error: linker command failed with exit code 1 (use -v to see invocation)

环境

System:
OS: macOS High Sierra 10.13.6
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 2.96 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.5.0 - /usr/local/bin/node
npm: 6.1.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 27.0.3, 28.0.0, 28.0.3
System Images: android-26 | Google APIs Intel x86 Atom_64, android-26 | Google Play Intel x86 Atom, android-27 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5692245
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.4 => 0.60.4
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
react-native-rename: 2.4.1

最佳答案

您可能正在打开 React-Native 的 .xcodeproj 文件。

从 React-Native 0.60 开始,默认包含 cocoapods,这意味着正在创建一个 .xcworkspace 文件。这本质上是 xcode 项目的集合,包括您的react-native 项目和cocoapods 库项目。

后者包含所有(react-native) native 依赖项。每当您打开 .xcodeproj 文件时,这些依赖项都不包含在项目中,并且 xcode 不知道这些文件存在。这解释了为什么链接器也找不到它们。

关于xcode - React-native 0.60.4 xcode 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57372683/

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