Can't install cocoapods on macOS Big Sur - ios

I am using MacOS Big Sur 11.0 Beta.
I tried to install cocoapods but I can't.
First, I tried with;
sudo gem install cocoapods
It says
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
Then, I tried with;
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew cleanup -d -v
brew install cocoapods --build-from-source (also tried with "brew install cocoapods")
It says
Error: pkg-config: no bottle available!
You can try to install from source with:
brew install --build-from-source pkg-config
So, I tried brew install --build-from-source pkg-config, and it says Error: macOS '10.16' is invalid.
Anybody can help me?

Related

Error: /usr/local/Cellar/xz/5.2.4 is not a valid keg

I wanted to install package gdal on my Mac. I ran arch -x86_64 brew install gdal. However, it returned this error:
Error: /usr/local/Cellar/xz/5.2.4 is not a valid keg
You need to run brew update before the gdal installation, the latest xz is 5.4.1.
If still does not work, can you also update the OP and include brew config and brew doctor outputs?

Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)

I tried to upgrade with Brew
$ brew upgrade stripe/stripe-cli/stripe
I got:
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.
AS suggested, I tried
$ arch -arm64 brew install
But got:
Error: Invalid usage: This command requires at least 1 formula or cask argument.
I tried installing Rosetta 2 according to this tutorial
$ /usr/sbin/softwareupdate --install-rosetta --agree-to-license
But I got:
Installing Rosetta 2 on this system is not supported.
Seems homebrew has to be used like this from now on:
arch -arm64 brew upgrade
I added the original argument to arch -arm64 brew upgrade and it worked
$ arch -arm64 brew upgrade stripe/stripe-cli/stripe
Well, all other answers seemed like a workaround for me, I would recommend to do this
cd /opt
sudo mkdir homebrew
sudo chown $(whoami):admin homebrew
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
Then just reload terminal and your brew install xxx should work just fine.

Flutter Doctor CocoaPods not installed

When I run Flutter doctor:
I have tried to run sudo gem install cocoapods to install it but still the same issue.
Please not that I am running xcode 12 with the newest flutter version in the dev channel.
Any ideas?
Error after running the flutter build:
What worked for me was to uninstall Cocoapods using sudo gem uninstall cocoapods and using Homebrew instead brew install cocoapods. P.s. I'm using an M1 Macbook.
I had the same problem and after hours of looking for a solution, I solved it with these steps:
(prerequisites: install homebrew first. To check if installed, in your terminal, type $ brew -v )
$ sudo gem uninstall cocoapods (skip this part if cocoapods is not installed. command $pod --version , will tell you if it's installed or not)
$ brew install cocoapods
If there's an error 'The brew link step did not complete successfully
The formula built,........, command $ brew link --overwrite cocoapods
$ brew reinstall cocoapods
$ flutter run
My operating system is macOS Big Sur.
Are you getting an error when you tried to sudo gem install cocoapods? I had to do sudo gem install ruby first to make it work on my Mac.
In my case the problem was that there was no ruby installation on my mac after a clean install of MacOSX Catalina. So what I did, was first to install Ruby Version Manager with this command:
\curl -sSL https://get.rvm.io | bash -s stable --rails
The RVM installed Ruby on my system along with other dependencies. After that I was able to install cocoapods with the recommended command:
sudo gem install cocoapods
and it worked flawlessly for me after that. Hope this helps. It seems that Apple has removed many developer tools lately from its systems, Ruby being one of them :(

`brew upgrade <package>`: "<package> cannot be built with any available compilers"

For example, I tried to run brew upgrade ruby-build.
That failed with error:
CompilerSelectionError: ruby-build cannot be built with any available compilers.
Install GNU's GCC
brew install gcc
When I ran brew install gcc , I got:
Warning: Building gcc from source:
The bottle needs the Xcode CLT to be installed.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: An exception occurred within a child process:
CompilerSelectionError: gcc cannot be built with any available compilers.
Install GNU's GCC
brew install gcc
How can I upgrade ruby-build via brew?
I ran this command and it now works:
xcode-select --install
I had to reset xcode to the default command line tools path with
sudo xcode-select -r
for this to work

ideviceinstaller fails with "Could not connect to lockdownd. Exiting."

When I try to use ideviceinstaller, the command fails with the following error message:
"Could not connect to lockdownd. Exiting."
Example commands:
ideviceinstaller -l
ideviceinstaller -i Something.ipa
I have googled more than an hour to find the solution, however nothing worked for me:
Reinstall ideviceinstaller
Reinstall libimobiledevice
Reinstall brew and reinstall again both ideviceinstaller, libimobiledevice
It works only if I use sudo but it's unfortunately not acceptable in my case.
System paramereters:
MacBookPro with 10.11.5 OSX El Capitan
Target devices: iPhone 5, iPad 2
Note:
I have installed both Xcode 7.3.1 and Xcode 8 beta 3 on my computer. And used these commands to switch between them:
sudo xcode-select -switch /Applications/Xcode-beta.app/
sudo xcode-select -switch /Applications/Xcode.app/
Meanwhile I found the answer. This command will add durable privileges to use ideviceinstaller:
sudo chmod -R 777 /var/db/lockdown/
Just FYI: updates to macOS, iTunes, and probably other Apple software will (correctly) reset the permissions on /var/db/lockdown.
The best solution here is to get the latest libimobiledevice, which has a fix for this particular issue:
brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew link --overwrite libimobiledevice
brew install ideviceinstaller
brew link --overwrite ideviceinstaller
I had many problems with ideviceinstaller too, so at least I have started to use cfgutil.
It's a CLI tool of Apple Configurator 2, always up-to-date and reliable, works well with iOS beta versions.
Just download the free app from the App Store: https://itunes.apple.com/hu/app/apple-configurator-2/id1037126344
Start the app then select "Apple Configurator 2 > Install Automation Tools" from the upper left menu.
To install/uninstall apps:
cfgutil --ecid $ECID remove-app $BUNDLE_ID_OF_INSTALLED_APP;
cfgutil --ecid $ECID install-app $PATH_TO_IPA_OR_APP_FOLDER;
To get ECID, connect an iOS device and run the following command:
cfgutil list
Here are the available functions: https://pastebin.com/ZzeueLK2
When you try this command:
ideviceinstaller -d -i Something.ipa
you will get a detailed error. In my case the error is:
lockdown.c:218 lockdown_check_result(): ERROR: PairingDialogResponsePending
11:28:09 lockdown.c:1012 lockdownd_do_pair(): Pair failure
Could not connect to lockdownd.
Exiting.
On further searching for this error no. 2 I found that there was a trust issue in the Iphone connected, so I opened the Iphone and gave trust device, then the issue got resolved.
To fix this, try first:
usbmuxd --force-exit
sudo usbmuxd -f -v
Then
ideviceinstaller -d -i Something.ipa
bellow commands solved my problem
brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew unlink libimobiledevice && brew link libimobiledevice
brew install --HEAD ideviceinstaller
brew unlink ideviceinstaller && brew link ideviceinstaller
sudo chmod -R 777 /var/db/lockdown/
If you are getting this error while brew install --HEAD libimobiledevice
:
"configure: error: Package requirements (libusbmuxd >= 1.1.0) were not met:
Requested 'libusbmuxd >= 1.1.0' but version of libusbmuxd is 1.0.10"
Below commands will solve the issue:
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
use above mentioned command ->sudo chmod -R 777 /var/db/lockdown/
if the above command does not work then, remove files from lockdown folder
-> cd /var/db/lockdown/
-> rm -rf *
then try ->ideviceinstaller -l
In my case, the steps doesn't work.
Finally, I find a way to resolve:
DISCONNECT your device!
run cmd in sequence:
brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew install ideviceinstaller
sudo chmod -R 777 /var/db/lockdown
that works for me.

Resources