sqlite3.dart icon indicating copy to clipboard operation
sqlite3.dart copied to clipboard

Build failed because of minimum macOS deployment version

Open sokcheahay6 opened this issue 10 months ago • 6 comments

Building flutter project on macos

my pubspec.lock file:

sqlite3: dependency: transitive description: name: sqlite3 sha256: a72c68360757d25a528652f9679dac6e5f23bc52af76b74d4687a148d74e06db url: "https://pub.dev" source: hosted version: "2.6.1" sqlite3_flutter_libs: dependency: transitive description: name: sqlite3_flutter_libs sha256: "50a7e3f294c741d3142eed0ff228e38498334e11e0ccb9d73e0496e005949e44" url: "https://pub.dev" source: hosted version: "0.5.29"

Build error: CocoaPods' output:

Error: The pod "sqlite3" required by the plugin "sqlite3_flutter_libs" requires a higher minimum macOS deployment version than the plugin's reported minimum version. To build, remove the plugin "sqlite3_flutter_libs", or contact the plugin's developers for assistance. Error: Error running pod install

sokcheahay6 avatar Jan 19 '25 06:01 sokcheahay6

Can you post your Podfile for macos?

simolus3 avatar Jan 19 '25 22:01 simolus3

Downgrading

dependency_overrides:
   sqlite3_flutter_libs: 0.5.27

temporarily resolved it for me.

kevinhikaruevans avatar Jan 24 '25 19:01 kevinhikaruevans

Can you post your Podfile

platform :osx, '10.14'

# 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', 'ephemeral', '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 Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_macos_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_macos_build_settings(target)
  end
end

magnus-ISU avatar Feb 01 '25 10:02 magnus-ISU

$ just macos                                                                                                                                       (master^) [~/D/m/c/p/total_recall]
cd flutter/assets ; if [ ! -f "sherpa-onnx-streaming-zipformer-en-2023-06-26.tar.bz2" ] ; then wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-en-2023-06-26.tar.bz2 ; fi ; if [ ! -d "sherpa-onnx-streaming-zipformer-en-2023-06-26" ]; then unar sherpa-onnx-streaming-zipformer-en-2023-06-26.tar.bz2 ; fi
cd flutter; flutter run -d macos
Launching lib/main.dart on macOS in debug mode...
Running pod install...                                             720ms
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`: (``)

    Finding Podfile changes
      - FlutterMacOS
      - flutter_local_notifications
      - flutter_recorder
      - path_provider_foundation
      - sherpa_onnx_macos
      - sqlite3_flutter_libs

    Fetching external sources
    -> Fetching podspec for `FlutterMacOS` from `Flutter/ephemeral`
    -> Fetching podspec for `flutter_local_notifications` from `Flutter/ephemeral/.symlinks/plugins/flutter_local_notifications/macos`
    -> Fetching podspec for `flutter_recorder` from `Flutter/ephemeral/.symlinks/plugins/flutter_recorder/macos`
    -> Fetching podspec for `path_provider_foundation` from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`
    -> Fetching podspec for `sherpa_onnx_macos` from `Flutter/ephemeral/.symlinks/plugins/sherpa_onnx_macos/macos`
    -> Fetching podspec for `sqlite3_flutter_libs` from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/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
      CDN: trunk Relative path: all_pods_versions_d_c_2.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/d/c/2/sqlite3/3.47.2/sqlite3.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/d/c/2/sqlite3/3.47.2/sqlite3.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/d/c/2/sqlite3/3.47.2/sqlite3.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/d/c/2/sqlite3/3.47.2/sqlite3.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/d/c/2/sqlite3/3.47.2/sqlite3.podspec.json exists! Returning local because checking is only performed in repo update
    [!] CocoaPods could not find compatible versions for pod "sqlite3":
      In snapshot (Podfile.lock):
        sqlite3 (= 3.47.2, ~> 3.47.2)

      In Podfile:
        sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/darwin`) was resolved to 0.0.1, which depends on
          sqlite3 (~> 3.48.0)

    Specs satisfying the `sqlite3 (= 3.47.2, ~> 3.47.2), sqlite3 (~> 3.48.0)` dependency were found, but they required a higher minimum deployment target.

    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in 'Molinillo::Resolver::Resolution#raise_error_unless_state'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in 'block in Molinillo::Resolver::Resolution#unwind_for_conflict'
    <internal:kernel>:91:in 'Kernel#tap'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in 'Molinillo::Resolver::Resolution#unwind_for_conflict'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:257:in 'Molinillo::Resolver::Resolution#process_topmost_state'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in 'Molinillo::Resolver::Resolution#resolve'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in 'Molinillo::Resolver#resolve'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/lib/cocoapods/resolver.rb:94:in 'Pod::Resolver#resolve'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/lib/cocoapods/installer/analyzer.rb:1082:in 'block in Pod::Installer::Analyzer#resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:64:in 'Pod::UserInterface.section'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/lib/cocoapods/installer/analyzer.rb:1080:in 'Pod::Installer::Analyzer#resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/lib/cocoapods/installer/analyzer.rb:125:in 'Pod::Installer::Analyzer#analyze'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:422:in 'Pod::Installer#analyze'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:244:in 'block in Pod::Installer#resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:64:in 'Pod::UserInterface.section'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:243:in 'Pod::Installer#resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:162:in 'Pod::Installer#install!'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/lib/cocoapods/command/install.rb:52:in 'Pod::Command::Install#run'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in 'CLAide::Command.run'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/lib/cocoapods/command.rb:52:in 'Pod::Command.run'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/gems/cocoapods-1.16.2/bin/pod:55:in '<top (required)>'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/bin/pod:25:in 'Kernel#load'
    /opt/homebrew/Cellar/cocoapods/1.16.2_1/libexec/bin/pod:25:in '<main>'

Error: The pod "sqlite3" required by the plugin "sqlite3_flutter_libs" requires a higher minimum macOS deployment version than the plugin's reported minimum version.
To build, remove the plugin "sqlite3_flutter_libs", or contact the plugin's developers for assistance.
Error: Error running pod install
error: Recipe `macos` failed on line 2 with exit code 1

magnus-ISU avatar Feb 01 '25 10:02 magnus-ISU

Can you post your Podfile for macos?

platform :osx, '10.14'

# 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', 'ephemeral', '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 Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_macos_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_macos_build_settings(target)
  end
end

sokcheahay6 avatar Feb 03 '25 03:02 sokcheahay6

Error: The pod "sqlite3" required by the plugin "sqlite3_flutter_libs" requires a higher minimum macOS deployment version than the plugin's reported minimum version.

What I don't understand is that:

  1. Pod sqlite3 has a dependency of macos 10.13 here.
  2. The deployment target in sqlite3_flutter_libs is higher than that.

simolus3 avatar Feb 03 '25 21:02 simolus3

This is also happening for sqlcipher_flutter_libs: 0.6.6. I fixed it by overriding the dependency

dependency_overrides:
  sqlcipher_flutter_libs: 0.6.5

velten-dev avatar May 19 '25 00:05 velten-dev

For those still hitting this issue, I was able to solve it by deleting the Podfile.lock files and letting Flutter regenerate them. It seems to be some sort of lock issue that isn't automatically resolved when upgrading to v0.6.6+ from v0.6.5

velten-dev avatar Jul 30 '25 01:07 velten-dev

I am also having this problem.

Deleting Prodfile.lock did not seem to help.

I have not used depenency_overrides before. Do you set a dependency for a particular version and then also include a dependency override?

RidleyWrites avatar Jul 30 '25 14:07 RidleyWrites

Sometimes I also get that error when the repository is out of sync, pod repo update did help in some cases.

simolus3 avatar Jul 30 '25 14:07 simolus3

I just tried pod repo update and followed up with pod update in the macos folder of my app and it works now.

Thanks very much!

RidleyWrites avatar Jul 30 '25 15:07 RidleyWrites

Closing since:

  • it looks like this is fixable with CocoaPods
  • it shouldn't happen with SwiftPM
  • we're migrating to Dart build hooks in version 3.x of package:sqlite3, which also don't have this issue.

simolus3 avatar Nov 02 '25 11:11 simolus3