Baseflow / flutter_cached_network_image

Download, cache and show images in a flutter app
https://baseflow.com
2.44k stars 655 forks source link

CocoaPods could not find compatible versions for pod "sqflite" #530

Open ash007osh opened 3 years ago

ash007osh commented 3 years ago

🐛 Bug Report

After installing flutter_cached_network_image my project stopped running and upon flutter run I see below error:

[!] CocoaPods could not find compatible versions for pod "sqflite": In Podfile: sqflite (from.symlinks/plugins/sqflite/ios`)

Specs satisfying the sqflite (from.symlinks/plugins/sqflite/ios) dependency were found, but they required a higher minimum deployment target.`

I tried all the methods given here: https://stackoverflow.com/questions/56086585/flutter-error-on-pod-install-cocoapods-could-not-find-compatible-versions-for-p

Expected behavior

Should have run without any issues.

Reproduction steps

Using this package with below flutter version:

Flutter 1.22.4 • channel stable • https://github.com/flutter/flutter.git Framework • revision 1aafb3a8b9 (6 weeks ago) • 2020-11-13 09:59:28 -0800 Engine • revision 2c956a31c0 Tools • Dart 2.10.4

Configuration

Version: 1.x

Platform:

doomkin commented 3 years ago

Add ios/Podfile

# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
use_frameworks!
use_modular_headers!

def parse_KV_file(file,seperator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  pods_ary = []
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) { |line|
      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
      plugin = line.split(pattern=seperator)
      if plugin.length == 2
        podname = plugin[0].strip()
        path = plugin[1].strip()
        podpath = File.expand_path("#{path}", file_abs_path)
        pods_ary.push({:name => podname,:path=>podpath});
      else
        puts "Invalid plugin specification: #{line}"
      end
  }
  return pods_ary
end

target 'Runner' do
  # Flutter Pods
  use_frameworks!
  use_modular_headers!
  generated_xcode_build_settings = parse_KV_file("./Flutter/Generated.xcconfig")
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter build or flutter run is executed once first."
  end
  generated_xcode_build_settings.map{ |p|
    if p[:name]=='FLUTTER_FRAMEWORK_DIR'
      pod 'Flutter', :path => p[:path]
    end
  }

  # Plugin Pods
  plugin_pods = parse_KV_file("../.flutter-plugins")
  plugin_pods.map{ |p|
    pod p[:name], :path => File.expand_path("ios",p[:path])
  }
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end
SKhatter commented 5 months ago

For me this got solved by adding an updated version of plarform in the podfile, something like this:

platform :ios, '12.0'