React native Pod install getting Permission denied - ios

I'm created new project using command react-native init testprog
then change dir to testprog and pod install but it give permission denied error
$ pod install
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Downloading dependencies
Installing CocoaAsyncSocket (7.6.5)
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.64.0)
Installing FBReactNativeSpec (0.64.0)
[!] /bin/bash -c
set -e
mkdir -p /Volumes/MACMINI DATA SSD/testprog/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec && touch /Volumes/MACMINI DATA SSD/testprog/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h /Volumes/MACMINI DATA SSD/testprog/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm
mkdir: /Volumes/MACMINI: Permission denied
I was try following things but it not working
update pod
reinstall pod
chown command for ~/.cocoapods
chown command for ~/Library/Caches/CocoaPods
chown command for /usr/local/bin/npm
chown command for /usr/local/bin/npx
chown command for /usr/local/bin/node
What is wrong?
How to resolve it?
Pod version: 1.10.1
Os Version: 10.15.7
react-native Version: 0.64.0

There can be multiple reason for this.
There is one solution which always worked for me is
sudo pod install --allow-root
Go to your ios folder -> Go to get info -> read & write (to your user) -> click on small setting button below there -> Apply to enclosed items.

Related

Cocoapods error while running ios app which leads error in pod install

I am trying to create both ios and android app and It works fine for android but for ios while running flutter run it will take lot of time installing pod using pod install and at last it will give an error as shown below.
Error output from CocoaPods:
↳
Cloning into
'/var/folders/f6/g4njsx3x5tx5dswcbsh29tdh0000gn/T/d20210605-16785-1rc0t
ko'...
fatal: unable to access 'https://github.com/grpc/grpc.git/': Failed to
connect to github.com port 443: Connection refused
Error running pod install
Error launching application on iPhone 12 Pro Max.
I tried these posts but no luck
error running pod install
error running pod install pods-runner
pubsec.yaml
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
image_picker: ^0.6.7+17
firebase_ml_vision: ^0.9.10
image_cropper: ^1.4.0
firebase_core: ^0.3.4
cloud_firestore: ^0.9.13+1
expandable: ^5.0.1
web_scraper:
If any extra information needed, Let me know in comments
After many research I found a solution,
Step 1: I removed all cocoapods and it's directory using
gem list --local | grep cocoapods
sudo gem uninstall EACH_OF_THEM // here EACH_OF_THEM means all the listed cocoapods
rm -rf ~/.cocoapods
Step 2: Installed HomeBrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step 3: Install cocoapods using HomeBrew
brew install cocoapods
Step 4: remove Podfile.lock if present
cd ios
rm Podfile.lock
Step 5: Now install pod
pod install --repo-update
It will take lot of time to download and install all the dependencies.
Now, If I run flutter project using flutter run. It succeed
...
Running pod install...
Running Xcode build...
...
refered link : dev.to

pod install mkdir Permission denied

I have a new React Native project with RN 64.0, when I run npx pod install it fail returning this:
npx: installed 1 in 27.036s
Scanning for pods...
1.10.1
> pod install
Auto-linking React Native modules for target `MyMALnew`: RNCAsyncStorage, RNCMaskedView, RNGestureHandler, RNReanimated, RNScreens, and react-native-safe-area-context
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Downloading dependencies
Installing CocoaAsyncSocket (7.6.5)
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.64.0)
Installing FBReactNativeSpec (0.64.0)
[!] /bin/bash -c
set -e
mkdir -p /Volumes/Macintosh HD - Data/WORK/MyMALnew/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec && touch /Volumes/Macintosh HD - Data/WORK/MyMALnew/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h /Volumes/Macintosh HD - Data/WORK/MyMALnew/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm
mkdir: /Volumes/Macintosh: Permission denied
ps: this is the first time I use npx prefix with RN, not sure if this is the issue here :)
Thanx for helping..
It's because your Volume name "Macintosh HD" consists of two words separated by space.
This generated path -> mkdir -p /Volumes/Macintosh HD should be replaced with mkdir -p "/Volumes/Macintosh HD" (added quotation marks) by RN team I think.
I had the same issue and renaming of my Volume to single word and reinstalling node_modules solved the issue.
Have you tried Running your pod install command using sudo.
Or Update your project directory permissions using chmod command.

You cannot run CocoaPods as root

when I execute sudo cordova requirements on my cordova project I get this response:
Requirements check results for ios:
Apple macOS: installed darwin
Xcode: installed [object Object]
ios-deploy: installed [object Object]
CocoaPods: not installed
/Users/username/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/claide-1.0.2/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)
But I already installed successfully cocoapods:
MacBook-Pro-di-Name:~ username$ sudo gem install cocoapods
Successfully installed cocoapods-1.5.3
Parsing documentation for cocoapods-1.5.3
Done installing documentation for cocoapods after 4 seconds
1 gem installed
MacBook-Pro-di-Name:project-cordova username$ pod --version
1.5.3
I looked for a similar problem in other posts like here or here. If I try the second solution I get
MacBook-Pro-di-Name:project-cordova username$ sudo chown -R $USER ~/Library/Caches/CocoaPods
chown: /Users/username/Library/Caches/CocoaPods: No such file or directory
MacBook-Pro-di-Name:project-cordova username$ sudo chown -R $USER ~/.cocoapods
chown: /Users/username/.cocoapods: No such file or directory
MacBook-Pro-di-Name:sbc-cordova username$ sudo chown -R $USER ./Pods
chown: ./Pods: No such file or directory
I also tried to update Ruby version on my Mac. Nothing worked for me. I have Sierra (10.12.3) and last Cordova version (8.0.0), any idea to solve this problem? Thanks in advance

CocoaPods error: RPC failed; curl 18 transfer closed with outstanding read data remaining

When I tried to import Realm with CocoaPods like this:
pod install --verbose --no-repo-update
then error happened:
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
fatal: clone of 'https://github.com/ColinH/PEGTL' into submodule path '/private/var/folders/51/tzbm7yqs3bsck5vxz3xj5pkc0000gn/T/d20160925-2957-1pu1dou/Realm/ObjectStore/external/pegtl' failed
why?
The above error is mainly caused by the change of the security mechanism of os10.11+ and cocoapods1.0+ version upgrade. Mainly in the pod setup process. And the waiting time for this process is very long
git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master
The same effect as pod setup
Mac OS 10.11, some cocoapods commands to change. If you have a pod setup or pod update problem, and it is difficult to solve, I suggest 10.11. Uninstall reinstall after installation of cocoapods has some different commands, the following summary:
1 check the ruby environment, if necessary, please update as follows
$ sudo gem update --system
2 uninstall cocoapods
$ sudo gem uninstall cocoapods
3 reinstall cocoapods (Setup command has changed)
Before 10.11
$ sudo gem install cocoapods
After 10.11
$ sudo gem install -n /usr/local/bin cocoa pods
4
$ sudo chmod +rx /usr/local/bin
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
//taking CocoaPods Specs repository copy to your computer under directory ~/.cocoapods
pod setup

Google Cocoapods Not Installing

Whenever I try to install any of Google's cocoapods I get one of two errors.
Either:
$ pod install
Analyzing dependencies
[!] The version of CocoaPods used to generate the lockfile (0.38.0.beta.2) is higher than the version of the current executable (0.37.2). Incompatibility issues may arise.
CocoaPods 0.38.0.beta.2 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Downloading dependencies
Installing Google (1.0.7)
[!] Error installing Google
...
inflating: /var/folders/<myDirectory>/Samples/signin/SignInExampleSwift/ViewController.swift
warning [/var/folders/<myDirectory>/file.zip]: 375 extra bytes at beginning or within zipfile
(attempting to process anyway)
Or:
$ pod install
[in /Users/<user>/Desktop/FakeProject]
Analyzing dependencies
CocoaPods 0.38.0.beta.2 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Downloading dependencies
Installing AppInvites (1.0.1)
[!] Error installing AppInvites
[!] /usr/bin/tar xfz /var/folders/<myDirectory>/file.tgz -C /var/folders/<myDirectory>
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
I've been trying this with both new and existing objective-c projects and have tried uninstalling and re-installing cocoapods. Not really sure what the issue seems to be and Google doesn't have any troubleshooting for their cocoapods.
Try updating your gem
sudo gem update -n /usr/local/bin cocoapods
pod install
Deleting podfile.lock and pod install fixed it for me.
I had the same issue and I did gem install cocoapods first then pod install worked fine.
After 6 hours i found this
go to http://cocoapods.org/ and download tar file

Resources