Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1.81 KB

10.md

File metadata and controls

38 lines (25 loc) · 1.81 KB
  1. In your IDE or editor, open the file pubspec.yaml. Add a dependency for cloud_firestore, then save the file
dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  english_words: ^3.1.0
  cloud_firestore: ^0.12.9+4     # new
  1. In your IDE (or a command line with its current directory set to your Flutter app directory), run flutter packages get.

If you get an error, make sure that the indentation in your dependencies block is exactly as shown above, using two spaces (not a tab).

Troubleshooting Android build fail:

If you're planning to develop using an Android device or emulator, you'll need to handle multidex support -- otherwise, your build will fail with "Cannot fit requested classes in a single dex file."

By default, Flutter supports Android SDK v16 (Jelly Bean, released 2012), but multidex doesn't really work with Jelly Bean (though, it's possible). Configuring Jelly Bean to work is beyond the scope of this codelab, so we'll change the minimum target SDK version from v16 to v21 (Lollipop, released 2014).

To change the minimum target SDK version:

  1. Open android/app/build.gradle, then find the line that says minSdkVersion 16.
  2. Change that line to minSdkVersion 21.
  3. Save the file.

Troubleshooting Xcode build fail:

If you're planning to develop using an iOS device or simulator, you'll need to resolve the "Multiple commands produce .../Flutter.framework" error.

  1. In the command line tool, go to the top-level directory of your Flutter app
  2. Run the command open ios/Runner.xcworkspace to open Xcode.
  3. In Xcode, go to File > Workspace Settings, then select Legacy Build System (see screencap below).
  4. Click Done, then quit Xcode.

Your iOS build should now succeed.