Ad

Flutter 'Packages Get' Failed After Adding Firebase Dependency

- 1 answer

I am trying to add Firebase to my flutter app. But when I add firebase_core dependency in the pubspec_yaml and run Packages get, it gives an error.

19-----dependencies:
20-----flutter:
21-----sdk: flutter
22-----firebase_core: ^0.2.5 

This is the code that gives the error.

The output of Packages get :

C:\flutter\bin\flutter.bat --no-color packages get
Running "flutter packages get" in trial_one...                  
Error on line 21, column 5 of pubspec.yaml: A dependency may only have one source.
sdk: flutter
^^^^^^^^^^^^^^


pub get failed (65)
Process finished with exit code 65

I followed the exact instructions on the Add Firebase to Flutter site. But still I get this error.

Ad

Answer

The indentation is actually not good, here's the correct one :

dependencies:
  flutter:
    sdk: flutter
  firebase_core: ^0.3.1+1

Hope it's help !!

Ad
source: stackoverflow.com
Ad