question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pod install fails (not M1) — 401 when installing Boost

See original GitHub issue

Description

Following the docs, I’m initializing a new react-native with Typescript repo with the command

npx react-native init myproject --template react-native-template-typescript

Upon running that command, I get the following:

✔ Downloading template
✔ Copying template
✔ Processing template
✖ Installing CocoaPods dependencies (this may take a few minutes)
✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./myproject/ios && pod install".

So I cd into the ios/ directory and run pod install. Everything installs propery, but when I get to boost…

Installing boost (1.76.0)

[!] Error installing boost
[!] /usr/bin/curl -f -L -o /var/folders/55/_ncpv5xd2hj2q2_k5m2bmn6r0000gn/T/d20220321-2395-th53eu/file.tbz https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2 --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.11.3 cocoapods-downloader/1.5.1'

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0    80    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 401

I understand that it’s the request to jfrog.io that’s giving me the 401, but how do I get around this? I’m not even clear on why access to this package would be forbidden in the first place. Strangely, I can install the tar.bz2 file directly just by putting that URL into my address bar. Why would it return a 401 to cURL?

I’m a web developer so I’m used to the npm ecosystem and have never faced a 401 before.

What can I do to move past this?

Version

0.67.4

Output of npx react-native info

info Fetching system and libraries information… System: OS: macOS 12.1 CPU: (12) x64 Intel® Core™ i7-9750H CPU @ 2.60GHz Memory: 294.95 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 14.19.1 - /usr/local/opt/node@14/bin/node Yarn: 1.22.18 - /usr/local/bin/yarn npm: 6.14.16 - /usr/local/opt/node@14/bin/npm Watchman: 2021.10.18.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0 Android SDK: API Levels: 28, 29 Build Tools: 28.0.3, 29.0.3 System Images: android-26 | Google Play Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 3.6 AI-192.7142.36.36.6392135 Xcode: 12.0/12A7209 - /usr/bin/xcodebuild Languages: Java: 1.8.0_252 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.67.4 => 0.67.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

  1. run npx react-native init myproject --template react-native-template-typescript
  2. cd into ios
  3. run pod install

Snack, code example, screenshot, or link to a repository

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:25 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
Tycholizcommented, Mar 23, 2022

I found a workaround, though admittedly it’s pretty lame and is no better than a bandaid solution. The approach is to download the file and then source it from the local filesystem, rather than making a network call:

  1. Download the tar.bz2 file from https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2
  2. move the (compressed) file to node_modules/react-native/third-party-podspecs
  3. open node_modules/react-native/third-party-podspecs/boost.podspec
  4. change the :http part of the spec.source key to:
:http => 'file:' + __dir__ + '/boost_1_76_0.tar.bz2'
  1. run pod install

note: you may need to adjust the version of the boost package your project specifies.

5reactions
crackerackcommented, Oct 10, 2022

I am still seing this issue. Is there anything besides the workaround? A lot of people seem to have reported this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CocoaPods Fails On Apple Silicon | Apple Developer Forums
Hi, I was trying to build my app on Apple Silicon on a DTK, but it fails, because the RubyGems is having some...
Read more >
Pod install fails on m1 macbook - Stack Overflow
In Xcode Preferences > Location , my Command Line Tools setting was empty. I clicked the dropdown and set it accordingly. · I...
Read more >
M1 and React Native (Not a headache) - DEV Community ‍ ‍
Pod installation for glog mostly crashes with an error that looks something like: error: C compiler cannot create executables . Once again, the ......
Read more >
How to fix “pod install” error in React Native on Mac M1
Install cocoapods again, but using brew this time, as it will install another version compatible with the architecture of your M1 CPU: brew...
Read more >
CocoaPods Repositories - JFrog - JFrog Documentation
The public CocoaPods Specs repo does not contain any actual binary ... that the Stash Archive Plugin is installed on your Bitbucket server....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found