Closed ArslanAsghar123 closed 2 weeks ago
i am able to resolve this issue as The error you're seeing (LoadError - cannot load such file -- ffi_c) generally occurs because the ffi (Foreign Function Interface) gem, which CocoaPods require, is either missing or incompatible with your current Ruby and macOS version.
I run these commands respectively
sudo gem uninstall ffi sudo gem install ffi brew install rbenv pod update pod install
NOTE: remember to delete podfile.lock pod update before
Thanks for the update @ArslanAsghar123 this can help others searching for the same issue
How can we help?
getting this while pod install
i downgraded oneSignal but issue remains
this is podFile
Uncomment this line to define a global platform for your project
platform :ios, '13.0'
CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, }
def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), FILE) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end
File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do use_frameworks! use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
target 'RunnerTests' do
inherit! :search_paths
end
end target 'OneSignalNotificationServiceExtension' do pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0' end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end end
Updating spec repo trunk
――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Command
/usr/local/bin/pod repo update
Report
What did you do?
What did you expect to happen?
What happened instead?
Stack
CocoaPods : 1.16.2 Ruby : ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin24] RubyGems : 3.0.3.1 Host : macOS 15.1 (24B83) Xcode : 16.1 (16B40) Git : git version 2.33.0 Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib Repositories : trunk - CDN - https://cdn.cocoapods.org/
Plugins
cocoapods-deintegrate : 1.0.5 cocoapods-plugins : 1.0.0 cocoapods-search : 1.0.1 cocoapods-trunk : 1.6.0 cocoapods-try : 1.2.0
Podfile
ruby
Uncomment this line to define a global platform for your project
platform :ios, '13.0'
CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, }
def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), FILE) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end
File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do use_frameworks! use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(FILE)) end
post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end end
target 'OneSignalNotificationServiceExtension' do use_frameworks! pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0' end
Error
LoadError - cannot load such file -- ffi_c /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in'
require' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in
require' /Library/Ruby/Gems/2.6.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi.rb:5:inrescue in <top (required)>' /Library/Ruby/Gems/2.6.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi.rb:2:in
<top (required)>' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:inrequire' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in
require' /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon.rb:3:in<top (required)>' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in
require' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:inrequire' /Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in
<top (required)>' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:inrequire' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in
require' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/cdn_source.rb:446:indownload_typhoeus_impl_async' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/cdn_source.rb:378:in
download_and_save_with_retries_async' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/cdn_source.rb:371:indownload_file_async' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/cdn_source.rb:344:in
download_file' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/cdn_source.rb:79:indeprecated_local_podspecs' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/cdn_source.rb:61:in
preheat_existing_files' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/cdn_source.rb:258:inupdate' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/sources_manager.rb:144:in
block (3 levels) in update' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:64:insection' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/sources_manager.rb:143:in
block (2 levels) in update' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/sources_manager.rb:142:ineach' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/sources_manager.rb:142:in
block in update' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/sources_manager.rb:140:inopen' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/sources_manager.rb:140:in
update' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/command/repo/update.rb:23:inrun' /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in
run' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/command.rb:52:inrun' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/bin/pod:55:in
<top (required)>' /usr/local/bin/pod:23:inload' /usr/local/bin/pod:23:in
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=cannot+load+such+file+--+ffi_c&type=Issues
If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods...
when I try to install pod 'GoogleMobileAdsMediationFacebook', show error https://github.com/CocoaPods/CocoaPods/issues/12635 [open] [2 comments] a week ago
LoadError - cannot load such file -- ffi_c https://github.com/CocoaPods/CocoaPods/issues/12440 [closed] [13 comments] 3 days ago
LoadError - cannot load such file -- ffi_c https://github.com/CocoaPods/CocoaPods/issues/12538 [closed] [2 comments] 10 Sep 2024
and 11 more at: https://github.com/cocoapods/cocoapods/search?q=cannot%20load%20such%20file%20--%20ffi_c&type=Issues&utf8=✓
Code of Conduct