pod install 'Firebase/Auth' results in [Bug] Bus Error - ios

I faced this issue with Ruby, they suggested this was either a problem with ethon or apple silicon. Wondered if anyone else has run into this and could point me the right way to solve. Please look below:
Steps:
Installed Cocoapods to use Google Firebase on new Mac mini. Successful install
Went through proper steps to generate a pod file in my Xcode project folder
Attempted to "pod install", and ran into the issue cited below
Please see details below in the following sections (bolded): Environment, Pod File, Mac Terminal Output, Crash Report - Full terminal output and crash report omitted here due to text length limitation on this site.
Environment:
OS: macOS Big Sur 11.3.1 (20E241)
IDE: Xcode 12.5 (12E262)
CocoaPods:
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods.rb
Ruby: ruby 2.6.3p62 (2019-04-16 revision 67580)
[universal.arm64e-darwin20]
Pod File
#Uncomment the next line to define a global platform for your project platform :ios, '9.0' target 'Mark' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Mark
pod 'Firebase/Auth'
end
Mac Terminal Output:
Analyzing dependencies
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.1/lib/ffi/library.rb:275: [BUG] Bus Error at 0x00000001007c4000
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]
...

Running gem install --user-install ffi -- --enable-libffi-alloc fixed my issue (Mac pro -M1 Pro)
The more details: https://github.com/ffi/ffi/issues/864#issuecomment-1024260535

Related

Cocoapods Segmentation Fault When Adding ‘google_sign_in’ Package to Flutter App (iOS Variant)

I can’t compile my Flutter App (iOS variant) when I added the package google_sign_in. At first, the symptom had to do with f f i pods (whatever they are). As per the resulting error message, I uninstalled ffi and re-installed it with the --enable-libffi-alloc switch as follows:

sudo gem uninstall ffi && sudo gem install ffi -- --enable-libffi-alloc
Now, I’m getting the following error:

Error output from CocoaPods:
/Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon/curls/infos.rb:127: [BUG] Segmentation fault at 0xffffffffffffffa8
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
Ive been looking for solutions to the above and the consensus seems to point to some pods incompatibility with my M1 processor. Ive been trying lots of suggestions for the past day, all to no avail, and I’m at wits end. Im hoping that somebody out there can help.

My environment is as follows:

Box: MacBook Air M1
OS: Monterey 12.2
Flutter Vers: 3.3.8
google_sign_in package vers: 5.4.2
 
Thanks in advance for any suggestions.

/Jose

I experienced the same issue, just with the firebase_core package.
The solution is the same as for https://stackoverflow.com/a/65334677/515239
Install cocoapods via Homebrew instead of using the system installed gem/ruby:
# Uninstall the local cocoapods gem
sudo gem uninstall cocoapods
# Reinstall cocoapods via Homebrew
brew install cocoapods
The preinstalled ruby is deprecated since MacOS Catalina:
https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes/
See also: https://www.freecodecamp.org/news/do-not-use-mac-system-ruby-do-this-instead/

Xcode: pod install error when creating new projects

firstly I am really new to iOS dev and to MAC's (Only owned one for a week)
I am trying to create an iOS application which requires a pod install, I have installed cocopods etc and I navigate to my project directory. I have then generated the pod file and added my required dependencies. When it run pod install, I get an error,
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: https://www.ruby-lang.org/bugreport.html
Top of error:
Analyzing dependencies
/Users/pilotman/.gem/ruby/2.6.0/gems/ethon-0.14.0/lib/ethon/curls/classes.rb:36: [BUG] Illegal instruction at 0x00000001021b4000
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]
Bottom of error:
[IMPORTANT]
Don't forget to include the Crash Report log file under
DiagnosticReports directory in bug reports.
zsh: abort pod install
This Question is pretty general...
Are you using an Macbook M1? Or an Intel Macbook?
If you are using an Intel macbook ...
$sudo gem install cocoapods
move to your folder run pod init
open your Podfile and add your targets e.g.
#platform :ios, '9.0'
target 'MyPod' do
# Pods for MyPod
pod 'Firebase/Auth'
end
Close Podfile
type pod install
type pod update
Open MyPod.xcworkspace and start working
if you are using M1 Mb do the same but start with
Right click on Terminal
Get Info -> Open with Rosetta
Open terminal and type sudo gem install ffi
Then do the steps above.
If this error is still occur let me know.
If you are on a Apple silicon then just do this
sudo gem uninstall cocoapods
brew install cocoapods
Try with the following commands:
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

SwiftSoup cocoapods install only and only version 1.4, not 1.5

I tried to install swiftSoup to parse HTML to my xCode project but unfortunately version of swiftSoup installed by command expressed in official site
is 1.4 which is unacceptable to work with swift 4.0. I found out that version of swiftSoup compatible with xCode 9 and swift 4.0 is swiftSoup ver.1.5.2 but I does not installs by command i tried from official site( even more i tried to mention version in a pod file and threw me an error.
How can I install the latest version if swiftSoup by cocoapods?
platform :ios, ’11.0’
This line indicate that what is your pod deployment target so it will install compatible pod with above platform sometime it's happened that after upgrade your project developer forgot to change this target that why sometime old pod install every time. So always change here if you changed the deployment target of your project.
put pod 'SwiftSoup', '~> 1.4' in your pod file and run pod install command and maybe it will help you to get 1.4 version of SwiftSoup
Finally I succeeded to install swiftSoup ver.1.5.8 after a lot of struggling. In general I needed to install classic ancient version of swiftSoup as described in official site (pod 'SwiftSoup') and with big help of Chirag Shah I got to know that I need to mention my target which is iOS 11 (remove hash sign and does this match with current deployment target) and I need to update my old-world pod by pod update command. Thats it. But there was a problem when I inserted command pod update I got and error:
Updating spec repo `master`[!]
Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down
So first I needed to resolve this problem with the big help of this link. I found out that I needed update openssl, then ruby, then cocoapod.
Here is copy of steps I took:
1.8.5-p52
1.8.5-p113
1.8.5-p114
1.8.5-p115
1.8.5-p231
1.8.6
:
2.5.0-rc1
2.5.0
2.6.0-dev
:
$ rbenv install 2.5.0
$ rbenv versions
* system (set by /Users/username/.rbenv/version)
2.5.0
$ ruby --version
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
$ rbenv global 2.5.0
$ rbenv versions
system
* 2.5.0 (set by /Users/username/.rbenv/version)
$ ruby --version
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
$ gem install cocoapods -n /usr/local/bin
$ which pod
/usr/local/bin/pod
$ pod --version
1.4.0
And then I can return to my project where I uninstalled my old pod and mention target ios 11:
platform :ios, ’11.0’
and eventually insert pod update command then cocopods will update my pod without any error =))

How to init pod for Xcode project in Mac Sierra

I've updated my Mac to latest Mac Sierra version. Now, I'm facing a problem with my Xcode project (Xcode 8). I cannot run "pod init" (pod install and pod update is working fine with old project).
The terminal shows this error :
Les-MacBook-Pro:testPod victory1908$ pod init
/Library/Ruby/Site/2.0.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException)
from /Library/Ruby/Site/2.0.0/rubygems.rb:298:in `activate_bin_path'
from /usr/local/bin/pod:22:in `<main>'
Les-MacBook-Pro:testPod victory1908$
What is this, and how can we init pod for a Xcode project in Mac Sierra?
I faced the same issue with macOS 10.12.5... As a result, I fixed it performing following commands on terminal:
sudo gem install activesupport -v 4.2.6
sudo gem install cocoa pods
It could be that you just have to update your ruby version to the latest and then install cocoapods gem and then all should be well. How to update your ruby version has been answered here: https://stackoverflow.com/a/38194139/7451779

Cocoapods use_frameworks! issue

I found out that the way to resolve an issue, in a library i'm using, is to add use_frameworks! to the podfile. When i run pod install on the terminal, i get the following error:
[!] Invalid Podfile file: undefined method `use_frameworks!' for #.
Updating CocoaPods might fix the issue.
I'm using Cocoapods so i don't understand this issue. This tag is required for projects using swift, i'm using objective-c.
Looks to me like the second part of that error message:
Updating CocoaPods might fix the issue.
Is your issue. use_frameworks! was added in CocoaPods 0.36.0 which was just released recently.
Use pod --version to see what you're currently running. Assuming it's earlier than 0.36.0 you'll need to update it with
[sudo] gem install cocoapods
Which is just the same way you originally installed it.
I had the same issue when trying to run pod install on my mac.
So incase anyone encounters this issue what worked for me was changing the current ruby version with rvm.
On console, Use rvm list to see what versions you have installed:
So the version of ruby that was running on my mac was ruby-2.1.2.
I changed it with:
rvm use ruby-2.2.2
and ran pod install again and it worked.

Resources