flutter run Error detected in pubspec.yaml

38 views Asked by At

when i run the program it shows this following error

error on line 43, column 15 of pubspec.yaml: Mapping values are not allowed here. Did you miss a colon earlier?
   ╷
43 │   flutter_test:
   │               ^
   ╵
exit code 65

error on line 43, column 15 of pubspec.yaml: Mapping values are not allowed here. Did you miss a colon earlier?
   ╷
43 │   flutter_test:
   │               ^
   ╵
exit code 65
2

There are 2 answers

0
ABDELWAHED ELOUED On

this type of errors is usually caused by indentation.YAML relies on proper indentation to define the structure of the document.make sure you are using spaces not tabs and be sure of the level of your content. If you provide the file I may be able to assist you further.

0
yasith On
  1. step 1 - Make sure that your pubspec.yaml file is properly formatted.
  2. step 2 -Indentation: make sure the indentation is consistent
  3. Definitely put colons (:) after each key in the mapping

flutter_test:
  key1: value1
  key2: value2

  1. Spacing: check whether there are any extra spaces or tabs hence YAML is sensitive to indentation and spacing