如何通过适用于 iOS 的 React Native 环境设置来安装 Boost?

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

我目前正在尝试在 React Native 版本 0.73 中启动一个项目,但是当我在 iOS 目录中执行

pod install
时遇到问题,特别是安装 Boost 版本 1.83.0 时。

(node:66063) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Framework build type is static library
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
[Codegen] Found rncore
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Fetching podspec for `hermes-engine` from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`
[Hermes] Using release tarball from URL: https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.73.1/react-native-artifacts-0.73.1-hermes-ios-debug.tar.gz
Downloading dependencies
Installing CocoaAsyncSocket (7.6.5)
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.73.1)
Installing FBReactNativeSpec (0.73.1)
Installing Flipper (0.201.0)
Installing Flipper-Boost-iOSX (1.76.0.1.11)
Installing Flipper-DoubleConversion (3.2.0.1)
Installing Flipper-Fmt (7.1.7)
Installing Flipper-Folly (2.6.10)
Installing Flipper-Glog (0.5.0.5)
Installing Flipper-PeerTalk (0.0.4)
Installing FlipperKit (0.201.0)
Installing OpenSSL-Universal (1.1.1100)
Installing RCT-Folly (2022.05.16.00)
Installing RCTRequired (0.73.1)
Installing RCTTypeSafety (0.73.1)
Installing React (0.73.1)
Installing React-Codegen (0.73.1)
Installing React-Core (0.73.1)
Installing React-CoreModules (0.73.1)
Installing React-Fabric (0.73.1)
Installing React-FabricImage (0.73.1)
Installing React-ImageManager (0.73.1)
Installing React-Mapbuffer (0.73.1)
Installing React-NativeModulesApple (0.73.1)
Installing React-RCTActionSheet (0.73.1)
Installing React-RCTAnimation (0.73.1)
Installing React-RCTAppDelegate (0.73.1)
Installing React-RCTBlob (0.73.1)
Installing React-RCTFabric (0.73.1)
Installing React-RCTImage (0.73.1)
Installing React-RCTLinking (0.73.1)
Installing React-RCTNetwork (0.73.1)
Installing React-RCTSettings (0.73.1)
Installing React-RCTText (0.73.1)
Installing React-RCTVibration (0.73.1)
Installing React-callinvoker (0.73.1)
Installing React-cxxreact (0.73.1)
Installing React-debug (0.73.1)
Installing React-graphics (0.73.1)
Installing React-hermes (0.73.1)
Installing React-jserrorhandler (0.73.1)
Installing React-jsi (0.73.1)
Installing React-jsiexecutor (0.73.1)
Installing React-jsinspector (0.73.1)
Installing React-logger (0.73.1)
Installing React-nativeconfig (0.73.1)
Installing React-perflogger (0.73.1)
Installing React-rendererdebug (0.73.1)
Installing React-rncore (0.73.1)
Installing React-runtimeexecutor (0.73.1)
Installing React-runtimescheduler (0.73.1)
Installing React-utils (0.73.1)
Installing ReactCommon (0.73.1)
Installing SocketRocket (0.6.1)
Installing Yoga (1.14.0)
Installing boost (1.83.0)

[!] Error installing boost
Verification checksum was incorrect, expected 6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e, got 5e89103d9b70bba5c91a794126b169cb67654be2051f90cf7c22ba6893ede0ff

我尝试关注一些关于如何使用 M1 芯片设置 React Native 的博客,但结果不成功:How to fix “pod install” error in React Native on Mac M1

Xcode 命令行工具:Xcode 14.3.1
节点:21.5.0
macOS:文图拉 13.5

node.js react-native npm boost cocoapods
4个回答
17
投票

移至node_modules/react-native/third-party-podspecs 在 boost.podspec 中仅更改行

spec.source = { :http => 'https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2',
:sha256 => '6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e' }

spec.source = { :http => 'https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.bz2',
:sha256 => '6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e' }

也许 jfrog 关闭了他们的服务器


2
投票

我解决了问题。对于我来说,这是缓存问题。我一一运行下面的命令并能够成功安装 pod,

In project directory
npm cache clean --force --verbose
npm cache verify
npm install --force --verbose

In iOS folder
pod cache clean --all
rm -rf Podfile.lock
pod repo update
pod install

0
投票

这与 jFrog 的上游问题有关。

与其手动更改校验和,更好的方法是使用镜像下载包。这可以通过创建在

npm install
期间应用的补丁以可重复的方式完成(与 CI/CD 兼容)。

有关说明,请参阅:https://github.com/boostorg/boost/issues/843#issuecomment-1872943124


0
投票

此问题的正确答案也显示为类似问题的答案。

长话短说,只需更改 node_modules/react-native/third-party-podspecs

中的行

https://stackoverflow.com/a/77738910

https://stackoverflow.com/a/77740505/13493658

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