1

I've got my app working with the Firebase RTDB but want to experiment with Firestore so I have followed the instructions and installed the 'firebase_firestore' plugin.

When I run my app now I get the following error:

 Resolving dependencies of `Podfile`
    [!] Unable to satisfy the following requirements:

    - `Firebase/Firestore` required by `firebase_firestore (0.0.1)`

    Specs satisfying the `Firebase/Firestore` dependency were found, but they required a higher minimum deployment target.

I've tried specifying platform :ios, '9.0' and also 10.0in my Podfile but that didn't make any difference. All other pods install fine.

Here's the entire Cocoapods run log: https://pastebin.com/raw/SBz8Bqgf

My Podfile looks like this (standard Flutter Podfile):

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

if ENV['FLUTTER_FRAMEWORK_DIR'] == nil
  abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework')
end

target 'Runner' do
  # Pods for Runner

  # Flutter Pods
  pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR']

  if File.exists? '../.flutter-plugins'
    flutter_root = File.expand_path('..')
    File.foreach('../.flutter-plugins') { |line|
      plugin = line.split(pattern='=')
      if plugin.length == 2
        name = plugin[0].strip()
        path = plugin[1].strip()
        resolved_path = File.expand_path("#{path}/ios", flutter_root)
        pod name, :path => resolved_path
      else
        puts "Invalid plugin specification: #{line}"
      end
    }
  end
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

Here's a link to the Podfile.lock, maybe that's more interesting. I see that it has not been updated with Firestore though, presumably because the run fails: https://pastebin.com/raw/hj2jHE76

Cœur
  • 37,241
  • 25
  • 195
  • 267
Bjørn Børresen
  • 1,002
  • 11
  • 20
  • 1
    Please update your question to include the code from your `Podfile`. – Jen Person Oct 12 '17 at 23:38
  • Hi @JenPerson - I added the Podfile + a log of the Cocoapods run. The Podfile is AFAIK a standard Flutter Podfile, can't recall making changes to it (except trying to specify the platform version) – Bjørn Børresen Oct 13 '17 at 08:31

2 Answers2

2

In case anyone else stumbles across this issue I just wanted to expand on V. Roussel's answer (which I marked as the correct answer), since Flutter kind of abstracts away this Cocoapods process. Here's what I did to be able to run "pod repo / update":

  1. Run pod repo update
  2. Set the environment variable FLUTTER_FRAMEWORK_DIR to something that looks like /Users/youruser/bin/flutter/bin/cache/artifacts/engine/ios/. You can do a locate Flutter.podspec to find this directory
  3. From YourFlutterProject/ios run pod update

After this you should be able to run your app again.

Bjørn Børresen
  • 1,002
  • 11
  • 20
0

cloud_firestore has progressed to 0.03 by now, which should allow you to run the PODs.

in pubspec.yaml cloud_firestore: "^0.0.3"

If that does not work from the start, add Firebase core to your podfile and run pod install.

Note: As far as I have seen, you cannot yet combine Firestore with other modules such as Firebase auth or Firebase analytics.

jimh
  • 1,651
  • 2
  • 15
  • 28
Arno Zwaag
  • 305
  • 2
  • 4
  • Hi, ref your Note at the end there - combining Firestore and others (Auth/Firebase RTDB etc.) have worked fine until recently - it's a regression caused by the various Flutter packages referencing different versions of the underlying Firebase packages. This issue is tracked here: https://github.com/flutter/flutter/issues/12945 – Bjørn Børresen Nov 17 '17 at 10:03
  • 1
    Hey Bjorn, i did se that coming up. I actually posted issue https://github.com/flutter/flutter/issues/13341 there, which resolves to issue 12945, because i could not get it to work. Now i do not wish to attach my project directly to the GIT rope, nor do i want it to be a part of the example set. Guess i just have to wait it out until the fix becomes generally available in the regular Aplha set. Thanks for pointing it out though. – Arno Zwaag Dec 07 '17 at 22:40