Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error on line 1, column 1 of pubspec.lock: Unexpected character

I tried to run flutter pub get and I got this error:

Error on line 1, column 1 of pubspec.lock: Unexpected character
╷

1 │
│ ^

  ╵
pub upgrade failed (65;   ╵)
like image 666
hassan Avatar asked Jul 15 '20 08:07

hassan


Video Answer


2 Answers

The file pubspec.lock is a generated file, so you can delete it and then regenerate it.

Delete pubspec.lock.

Run the following command:

flutter pub get

or

flutter pub upgrade

Notes on pub upgrade (you could probably skip the delete step).

like image 174
Suragch Avatar answered Oct 03 '22 21:10

Suragch


Delete the file at flutter/packages/flutter_tools/pubspec.lock then try flutter pub upgrade again.

You may have interrupted the upgrade process before it finished hence the file became invalid.

like image 21
itai neil chiriseri Avatar answered Oct 03 '22 21:10

itai neil chiriseri