pod install fails with dylib not found - ios

My podfile is this.
# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'
target 'Task Tracker' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Task Tracker
pod 'RealmSwift', '~> 10'
end
I am trying to run pod install
It gives me error LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle, 0x0009): dependent dylib '#rpath/libffi.7.dylib' not found for '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle' - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle
What I tried
gem install ffi
arch -x86_64 pod install
Still same error. What am I missing?

If you're using Intel chip Mac and getting this error after trying the above command also, it's because of the cocoa pods installed on your Mac (Not installed properly). Completely remove the cocoapods and install it again from the beginning. This solution will work.

Jump to /usr/local/opt/libffi/lib, and ln -s libffi.8.dylib libffi.7.dylib
tips: libffi.8.dylib is your current ffi lib

Related

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

iOS 14 and Swift 5 Updates [duplicate]

I've just downloaded Xcode 12 beta 6. I've installed firebase into the project and I get this error. When I correct it with the suggestion it then tells me to correct again with the original. This error is repeated for all 'GoogleDataTransport'. Can you use Firebase with Xcode 12 beta 6? What am I doing wrong? Thanks
Update to CocoaPods 1.10, run pod deintegrate and pod install.
To work around in earlier CocoaPods versions, disable the CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER option in the generate Pods project Build Settings:
More details in https://github.com/firebase/firebase-ios-sdk/issues/5987 and https://github.com/CocoaPods/CocoaPods/issues/9902.
I fixed it by using the pre-release of cocoapods
sudo gem install cocoapods --pre
and then doing an update
pod install --repo-update
My team didn't want to use cocoapods 1.10 before it's released, and didn't want to re-edit the Pods project's build settings every time a pod install regenerates it. This Podfile post_install step did the trick, credit to Léo-Paul JULIE:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
end
end
Edit: As snakeoil points out below, you can also silence annoying warnings about irrelevant iOS versions which you are not supporting. But that setting should probably be edited for each target's configuration's build settings, so in a nested loop. All together, I'm going with something like this for now:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
# Can be removed when moving to cocoapods 1.10
config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# Inherit the deployment target defined in this Podfile instead, e.g. platform :ios, '11.0' at the top of this file
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
First, check for command line tools and install.
sudo xcode-select --switch /Applications/Xcode-beta.app
sudo xcode-select --install
Install cocoapods pre - beta version
sudo gem install cocoapods --pre
Switch to your xCode Project.
pod deintegrate
pod install --repo-update
In my case, Performance Monitoring Pod was causing this issue. When I was trying to install Performance Monitoring.
pod 'Firebase/Performance'
It somehow got conflict with Firebase Core Pod. To resolve it.
Comment Out all Firebase Pods in Podfile
Run Pod Install
Uncomment Firebase Performance Monitor in Podfile
Run Pod Install
Uncomment all other Firebase Pods in Podfile
Run Pod Install
This issue CAN be the result of developing iOS on an M1 (Apple Silicon) machine. In this case, the only way to fix the problem is to download a Ruby extension called "ffi" which you can read about here (for extra information): https://rubygems.org/gems/ffi/versions/1.0.9
To do this:
In Terminal, install ffi onto your machine using this command:
sudo arch -x86_64 gem install ffi
Then in your project file, install your podfile with this command:
arch -x86_64 pod install
This should allow you to install your pods (especially if you were getting a "zsh: abort pod install" problem. Notice Terminal will warn you "a bug in the Ruby interpreter or extension libraries".
After this, if your pod was FireStore/FireBase you may have to get another GoogleService-Info.plist file in your project.

Pod Installlation Getting Long Time and Not Install

I am trying to install Cocoapods, and it kind of hang while downloading AlamoFire!
Anyone have faced similar issue?
1) Open terminal
2) sudo gem install cocoapods
sudo gem install -n /usr/local/bin cocoapods
3) pod setup
4) create a xcode project
5) cd "path to your project root directory"
6) pod init
7) open -a Xcode Podfile
8) pod 'Alamofire', '~> 3.4'
It just feel like hanged and not sucessfull even after long wait!
Thanks in Advance!!!
Use this one in your pod file ->
**source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target 'Pod DemoTests' do
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire'
end**
this will solve your problem ..
pod Installation
1.sudo gem install cocoapods
2.pod init
3.import needed framework in podfile
4.pod install
5.open with workspace.

Getting error while installing pods via cocoapods on OS X El Capitan

I am running on OSX version 10.11 and Have installed Xcode 7.
I have created a new Xcode project and tried to install Alamofire using cocoa pod.
Following is the log which I am getting to do so. Anyone has any clarifications for this issue ? Thanks
Amiths-iMac:YakadaYakaDev Amith$ pod install
Updating local specs repositories
CocoaPods 0.39.0.rc.1 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.
Analyzing dependencies
dyld: warning, LC_RPATH #executable_path/../../../../../../../SharedFrameworks in /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/../../..//DVTInstrumentsFoundation.framework/Versions/A/DVTInstrumentsFoundation being ignored in restricted program because of #executable_path
dyld: warning, LC_RPATH #executable_path/../lib in /Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework/Versions/A/../../../../Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib being ignored in restricted program because of #executable_path
dyld: warning, LC_RPATH #executable_path/../lib in /Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework/Versions/A/../../../../Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib being ignored in restricted program because of #executable_path
dyld: warning, LC_RPATH #executable_path/../Frameworks in /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/MacOS/Xcode3Core being ignored in restricted program because of #executable_path
[!] Unable to satisfy the following requirements:
Alamofire (~> 3.0) required by Podfile
UPDATE:
When I update my pod file as below
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 2.0'
I am no longer getting the above error!
Try this
your pod installing
sudo gem install -n /usr/local/bin cocoapods
And Alamofire installing
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod "Alamofire", "~> 3.0.0-beta.3"

iOS Podfile error: undefined method 'source'

I am currently getting the following error when running pod install:
[!] Invalid `Podfile` file: undefined method `source' for #<Pod::Podfile:0x007fcf91b8c7a8>. Updating CocoaPods might fix the issue.
# from /Users/preston/Work/Test/Podfile:1
# -------------------------------------------
> source 'https://github.com/CocoaPods/Specs.git'
# platform :ios, '8.0'
# -------------------------------------------
I have tried the following:
pod repo remove master; pod setup
rm -rf ~/.cocoapods; pod setup
sudo gem uninstall cocoapods; sudo gem install cocoapods
After running the last bullet point I ran pod setup and got the following:
Setting up CocoaPods master repo
Already up-to-date.
CocoaPods 0.36.0 is available.
To update use: [sudo] gem install cocoapods
Setup completed (read-only access)
Which is confusing because I just updated.
Evening after running all of these commands I am still getting the above error. Does anyone know what might be going wrong?
Edit:
Here is my Podfile. However everything worked on another computer but not on mine:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

Resources