FITURE

If you can fight, fight.

首页 >> 分享>>pod install Installing boost (1.83.0) fails

pod install Installing boost (1.83.0) fails

Posted by fiture / 2025年02月13日 / 分享

在React Native Xcode 安装项目依赖时,ios 目录安装依赖boost依赖时报错,如下:

-> Installing boost (1.83.0) 

> Http download 

   $ /usr/bin/curl -f -L -o /var/folders/bd/24_nqq_503g0ypcdk8rdmr1w0000gn/T/d20250212-15483-gbhwci/file.tbz 

   https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2 --create-dirs 

   --netrc-optional --retry 2 -A 'CocoaPods/1.16.2 cocoapods-downloader/2.1' 

     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current 

                                    Dload  Upload   Total   Spent    Left  Speed 

   100   138  100   138    0     0     86      0  0:00:01  0:00:01 --:--:--    86 

   100 11534  100 11534    0     0   1780      0  0:00:06  0:00:06 --:--:--  2972 

  

[!] Error installing boost 

Verification checksum was incorrect, expected 6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e, got 79e6d3f986444e5a80afbeccdaf2d1c1cf964baa8d766d20859d653a16c39848 

看样子是提示文件hash值校验不通过。

查看文件 node_modules/react-native/third-party-podspecs/boost.podspec 显示13行,原来是一个文件地址,Google搜索得知,需要替换该地址。

方法一、手动替换

原地址:https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2

手动替换地址为:

https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.bz2

重新pod install 即可

方法二、手动替换 & 给 node_modules/react-native 打补丁

1、还是手动替换

2、替换后需要安装 `npm i patch-package -D` 工具

3、npx patch-package react-native,会生成一个patches/ 目录,记得提交到git里面

4、package.json 文件在scripts 里面新增postinstall脚本

"scripts": {
  "postinstall": "patch-package"
}

这样每次重新安装依赖时,就会自动替换patches里面的更改了,此方法适用于所有想修改node_modules依赖代码,又不想升级的情况。

综上,可能因为年久失修之前的地址服务器已经挂了,老版本的react-native(笔者使用react-native:0.73.1)又写死了地址,所以需要替换新地址。

参考地址:https://github.com/boostorg/boost/issues/843#issuecomment-1872943124 

2条回应:“pod install Installing boost (1.83.0) fails”

发表评论

电子邮件地址不会被公开。 必填项已用*标注