I have this problem when I try to do flutter pub get. How to solve this problem?
Asked Answered
M

5

6

I created a new flutter project where I put the flutter_bloc dependency but when I do flutter pub get I have this error.

[bloc] flutter pub get Running "flutter pub get" in bloc...
Because bloc depends on flutter_bloc ^6.0.1 which depends on bloc ^6.0.0, bloc ^6.0.0 is required.

So, because bloc is 1.0.0+1, version solving failed. pub get failed (1; So, because bloc is 1.0.0+1, version solving failed.) exit code 1 can someone help me please?

Mon fichier pubspec.yaml

Maritamaritain answered 6/8, 2020 at 19:48 Comment(0)
M
27

I solved my problem because I created the project with the name block and it created conflicts with flutter_bloc. Thanks to those who bothered to read my question

Maritamaritain answered 7/8, 2020 at 8:17 Comment(1)
the same here, lol, I just realized that I created the project with the name flutter_bloc. Thanks.Aloysia
F
0

You can fix this bug by changing versions of a package which you need in the app. I have a problem with flutter_bloc: 7.0.1 and bloc: 7.0.1 versions and just add

flutter_bloc: any

bloc: any
Files answered 27/6, 2021 at 16:2 Comment(1)
This doesn't work. Error on line 33, column 3 of pubspec.yaml: A package may not list itself as a dependency. ╷ 33 │ bloc: any │ ^^^^ ╵ pub get failed (65; ╵)Sepulchre
A
0

Rename your application name from 'bloc' to 'anythingYouPrefer', the reason for your problem is contradiction with the package and your application name

Airfoil answered 19/12, 2022 at 5:54 Comment(0)
S
0

The error I got:

Because flutter_bloc depends on flutter_bloc, version solving failed.

The reason: Is the project name and library name is same.

(My) Solution: Create another project with a different name.

Slatternly answered 14/1 at 8:47 Comment(0)
S
0

Just change your procject name becasue there is a conflict with your project name like bloc,flutter_bloc.

Selfanalysis answered 12/2 at 8:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.