Sdk: Error on line 15, column 8 of pubspec.yaml: Mapping values are not allowed here. Did you miss a colon earlier? http: "^0.11.3+16" ^

Created on 4 Apr 2018  路  13Comments  路  Source: dart-lang/sdk

I have facing the above issue while Get dependencies .

pubspec.yaml

dev_dependencies:
test: ^0.12.0
http: "^0.11.3+16"
image: "^1.1.30"

Error message

Running "flutter packages get" in dart_demo...
Error on line 15, column 8 of pubspec.yaml: Mapping values are not allowed here. Did you miss a colon earlier?
http: "^0.11.3+16"
^
pub get failed (65)

area-sdk closed-cannot-reproduce

Most helpful comment

You should give tab instead of spaces, one tab

All 13 comments

This means that the formatting (indentation) of the content in your pubspec.yaml is invalid.

You'd need to post the content of pubspec.yaml wrapped in ``` for anybody to be able to provide advice.

I'm not getting . I'm new for Dart lang. pls find pubspec.yaml below

name: dart_demo
description: A sample command-line application.
version: 0.0.1

environment:
  sdk: '>=1.20.1 <2.0.0'

dev_dependencies:
  test: ^0.12.0
  http: "^0.11.3+16"
  image: "^1.1.30"

I can't see a problem. Can you please attach the whole file?

@nex3 鈥撀爏ee anything obvious?

That pubspec works fine for me.

Maybe mixing tabs and spaces?

@zoechi @gowsikraja Could you fix it?? I am facing similar issue in my project too, if yes then please help me with it - https://github.com/AgrawalAnsh22/startup_namer/issues

@zoechi I just tried running the code in the validator, Thanks i got it resolved.

You should give tab instead of spaces, one tab

I found error in pubspec.yaml file of app module of project. You need to add
```
test: ^0.12.0
http: ^0.11.3+16
image: ^1.1.30

to **dev_dependencies** rather than in **dependencies**. Actual code snippet will be:

dev_dependencies:
flutter_test:
sdk: flutter
test: ^0.12.0
http: ^0.11.3+16
image: ^1.1.30
```
Then click on Package get (shown in Android Studio) option to add above dependency for the project. You can also do the same using command(in project stucture):

flutter packages get

image

I repeatedly read the flutter documentation, but still this error, why?

@O-ID You may try deleting the cache folder inside the bin folder and try again. Also try disabling any antivirus or firewall and try again. That might be it. Good luck

Was this page helpful?
0 / 5 - 0 ratings