1

I am trying to install image_picker and firbase_storage in my flutter project. But whatever version I try to install, it fails. and gives error like this -

Because image_picker >=0.3.0 requires Flutter SDK version >=0.1.4 <2.0.0 and image_picker <0.3.0 requires SDK version >=1.8.0 <2.0.0, image_picker is forbidden.

I have tried out installing every version but not able to install even a single version.

Flutter doctor -v is working fine and following is the content of my pubspec.yaml file

name: timepass
description: A new Flutter project.
version: 1.0.0+1

environment:
    sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter_secure_storage: ^3.1.3
image_picker: ^0.1.4
firebase_storage: ^0.2.0
location: ^1.4.1
graphql_flutter: ^0.9.1
flutter:
    sdk: flutter
cupertino_icons: ^0.1.2

dev_dependencies:
    flutter_test:
        sdk: flutter
4
  • If my answer does not help please post your dependencies: from pubspec.yaml Commented Feb 9, 2019 at 18:43
  • dependencies: flutter_secure_storage: ^3.1.3 image_picker: ^0.5.0 flutter: sdk: flutter cupertino_icons: ^0.1.2 Commented Feb 9, 2019 at 18:46
  • Can't reproduce. Please edit your question and put your whole pubspec.yaml there. Also please post add the output of flutter doctor -v Commented Feb 9, 2019 at 18:56
  • please post add the output of flutter doctor -v Commented Feb 9, 2019 at 21:50

2 Answers 2

1

One way to approach this kind of dependency issues is that just let the pub to fetch the appropriate version if you are facing any issues or conflicts with dependency.

Add the dependency on pubspec.yaml as below

dependencies:
  image_picker: any

or

dependencies:
  image_picker:

Then check the pubspec.lock file and find the version number.

In this case, you may get

image_picker:
    dependency: "direct main"
    description:
      name: image_picker
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.5.0"

Then you can modify pubspec.yaml as

dependencies:
  image_picker: ^0.5.0
Sign up to request clarification or add additional context in comments.

Comments

1

You need to allow a newer image_picker version.

Try

dependencies:
  image_picker:

or

dependencies:
  image_picker: ^0.5.0

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.