Search code examples
fluttermacosdartffmpegcocoapods

cocoa pods minimum version error ffmpeg kit flutter


So, I recently started working on Mac and I wanted to build my Flutter App, so I installed CocoaPods and started searching for a solution, but I couldn't find any that solved my problem, any help appreciated.

Tried to manage my dependencies version on my pubspec.yaml but didn't solve my problem.

My final thought is to replace the ffmpeg dependency version on the pod file (because its being set automatically) but I don't know how to do it.

This is my log output:

CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
      Using `ARCHS` setting to build architectures of target `Pods-RunnerTests`: (``)

    Fetching external sources
    -> Fetching podspec for `FlutterMacOS` from `Flutter/ephemeral`
    -> Fetching podspec for `ffmpeg_kit_flutter` from `Flutter/ephemeral/.symlinks/plugins/ffmpeg_kit_flutter/macos`
    -> Fetching podspec for `path_provider_foundation` from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`

    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_c_0_4.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/c/0/4/Flutter/3.13.0/Flutter.podspec.json exists! Returning local because checking is only performed in repo update
    [!] CocoaPods could not find compatible versions for pod "ffmpeg_kit_flutter/https":
      In Podfile:
        ffmpeg_kit_flutter (from `Flutter/ephemeral/.symlinks/plugins/ffmpeg_kit_flutter/macos`) was resolved to 6.0.3, which depends on
          ffmpeg_kit_flutter/https (= 6.0.3)

    Specs satisfying the `ffmpeg_kit_flutter/https (= 6.0.3)` dependency were found, but they required a higher minimum deployment target.

    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
    <internal:kernel>:90:in `tap'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:682:in `attempt_to_activate'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/lib/cocoapods/resolver.rb:94:in `resolve'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:1082:in `block in resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/lib/cocoapods/user_interface.rb:64:in `section'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:1080:in `resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:125:in `analyze'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:422:in `analyze'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/lib/cocoapods/user_interface.rb:64:in `section'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:243:in `resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:162:in `install!'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/lib/cocoapods/command/install.rb:52:in `run'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/lib/cocoapods/command.rb:52:in `run'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/cocoapods-1.14.3/bin/pod:55:in `<top (required)>'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/bin/pod:25:in `load'
    /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/bin/pod:25:in `<main>'

Exception: Error running pod install

This is My Mac Podfile:

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

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

Solution

  • On flutter project folder:

    cd macos
    pod install --repo- update
    pod install
    cd ..
    

    run flutter app