Deepak Rana
Deepak Rana

Reputation: 549

Adding image_picker dependency Error in Flutter

When I am trying to add image picker dependency in Flutter, I get the following error:

Error on line 22, column 3 of pubspec.yaml: A package may not list itself as a dependency.

image_picker: ^0.4.10

^^^^^^^^^^^^

Upvotes: 1

Views: 1222

Answers (1)

Dan Field
Dan Field

Reputation: 21641

It sounds like you named your package/application image_picker, and now pub can't tell it apart from the acutal image_picker already published that you want.

Double check the name property in your pubspec.yaml, and make sure it's not image_picker (or any other existing pub package name for that matter).

But please post your full pubspec.yaml, or even better a minimally complete reproduction of this issue if that's not the case.

Upvotes: 4

Related Questions