So Hello,
I know there are many similar Questions but only a few of them a specifically for Flutter.
My Problem:
I want to run my Flutter project but then this error shows up:
CocoaPods not installed or not in valid state.
Then i install cocoapods with this commant:
udo gem install -n /usr/local/bin cocoapods
However if i want to run:
pod install
it show this error:
[!] You cannot run CocoaPods as root. (CLAide::Help)
Thanks for any answer stackoverflow is my last hope
LG
Solution
Just run this command:
export PATH=$PATH:/usr/local/bin
and then:
pod setup
and
pod install
Solution
Just run this command:
export PATH=$PATH:/usr/local/bin
and then:
pod setup
and
pod install
Related
I always get this error when I run the 'pod install' command;
Here's the list of ways I've tried to fix it;
I deleted all pod files and reinstalled
pod install --repo-update
pod update
pod clean
sudo gem update cocoapods --pre
pod deintegrate
flutter clean
I would appreciate it if you could help me fix this error. Thanks
In macOS terminal I keep getting the [!] Unable to find source ref ... error message whenever I try to run pod install for any Xcode project. I have installed CocoaPods.
Full Error Message Examples:
[!] Unable to find source ref for CLTypingLabel.swift for target CLTypingLabel.
[!] Unable to find source ref for SVIndefiniteAnimatedView.m for target SVProgressHUD
[!] Unable to find source ref for NSButton+WebCache.m for target SDWebImage.
podfile:
platform :ios, '13.0'
target 'Myapp iOS13' do
use_frameworks!
pod 'CLTypingLabel'
end
I figured out how to get CocoaPods working! It seems there might be an issue installing pods on a secondary macbook account even though the account has full admin privileges. I logged into the primary or initial account created on the macbook, installed CocoaPods and pod install was able to install dependencies. I will also need to work on my project on the primary account instead.
My solution, brew must be uninstalled first:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
and
brew uninstall cocoapods
brew uninstall ruby
and
sudo gem install ffi
sudo gem install cocoapods
later remove (#) (#platform :ios, '15.0') and change ('15.0'):
# Uncomment the next line to define a global platform for your project
platform :ios, '15.0'
target 'Myapp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'CLTypingLabel'
end
finally
pod install
Do I need to type every time I open a new project : sudo gem install cocoapods , to install Cocoapods , or is it a one time thing ? and next time just get the project cd and install pod ?
CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects.
If you don't have installed cocoa pods earlier, to install cocoa pods into your machine execute the following command.
sudo gem install cocoa pods
To add the installed dependency manager to your project use the following command.
pod init.
This will create a file called podfile in your project directory. Include the dependencies in the file appropriately and execute pod install to install the dependencies.
Getting these two errors, after updating pods:
Use of undeclared identifier '__BYTE_ORDER'
Use of undeclared identifier '__LITTLE_ENDIAN'
Using Xcode Version 11.2.1 (11B53)
Well, I have solved my problem. I have done the following steps:
1) Uninstall pod:
To remove pods from a project completely you need to install two things.
a) Cocoapods-Deintegrate Plugin
b) Cocoapods-Clean Plugin
To install those, open your terminal and type
sudo gem install cocoapods-deintegrate
(Press enter)
sudo gem install cocoapods-clean
Now go to your project directory by typing this on your terminal
cd (path of the project) //Remove the braces after cd
Then press enter and type
pod deintegrate
to deintegrate pod. Then type
pod cache clean --all
to clean the cache. Now type
pod clean
to clean pod directory.
After completing the above tasks there should be the Podfile still remaining on your project directory. Just delete that manually or use this following command on the terminal.
rm Podfile
Then delete the DerivedData from Xcode by typing
rm -rf ~/Library/Developer/Xcode/DerivedData
Or follow the link to delete it manually.
Now remove Cocoapods from the system
sudo gem uninstall cocoapods
That's it. Now you have your project free from Pods & Cleaned.
2) Install pod:
After that, install a fresh pod to your project by following:
sudo gem install -n /usr/local/bin cocoapods
For MacOS, Catalina
sudo gem install -n /usr/local/bin cocoapods -v 1.8.4
Latest CocoaPods 1.10.0 seem not working. More info is here. Then give your project path
cd /your project path
Now type
pod setup
Init the Pod
pod init
Open Pod file and add Pod list into it
For example
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
Then install those pods.
pod install
Now open your-project.xcworkspace. The errors should be gone.
Thanks
A clean installation of Firebase pods worked for me:
1) Comment out or temporarily remove all Firebase related pods from the Podfile
2) Update pods - this will remove all previously installed pods - run:
pod update
3) Uncomment or add back the Firebase related pods and run 'pod update' to install them.
I read cocoa pods documents and many times try to installed but always fail to installed because in starting steps i found one error so i can't install gems first. can anyone give me steps one by one? how to install or demo.
this is one link which i try.
http://www.raywenderlich.com/12139/introduction-to-cocoapods
OUTPUT in terminal
$ sudo gem install cocoapods
or i try
$ sudo gem install cocoapods -V
ERROR: While executing gem ... (TypeError)
nil can't be coerced into Fixnum
Thanks
Just try this before install cocoa pods
$ sudo gem update —system
then use this commond
$ sudo gem install cocoapods
Hope this will solved your issue.
Seems like an issue with your Ruby installation. You're running 1.8.7(mentioned in comment) which has been retired: https://www.ruby-lang.org/en/news/2013/06/30/we-retire-1-8-7/
Update Ruby(see https://www.ruby-lang.org/en/) and then run:
sudo gem update --system
sudo gem install cocoapods