25

After running webdev serve it gives "Can't load Kernel binary: Invalid kernel binary format version. No active package webdev." this error

tried this and it added some dependencies

flutter packages pub global activate webdev
Tushar Anchliya
  • 387
  • 1
  • 3
  • 7

9 Answers9

49

Delete the bin/cache directory in your Flutter installation directory, then run flutter doctor.

Mali
  • 593
  • 6
  • 7
13

Open Flutter SDK folder, go to bin/cache and delete all the files + folders then run flutter doctor, and then flutter upgrade.

C.M Talha
  • 373
  • 2
  • 6
8

instead of webdev serve try to use flutter packages pub global run webdev serve and for getting and upgrading packages you can use flutter packages get and flutter packages upgrade respectively.

Harsha pulikollu
  • 2,386
  • 15
  • 28
2

I would add that deleting the bin/caches folder seems to be the solution when your xcode build freezes on the launch screen. It seems to be related to upgrading Flutter and/or rolling back afterwards (my case).

Lee Probert
  • 10,308
  • 8
  • 43
  • 70
  • also https://stackoverflow.com/a/65577277/17837810 this helped me to fix a error after deleting the bin/caches. – MBK Mar 02 '22 at 06:36
1

I had the same error in Xcode. pod update solves the problem.

IvanPavliuk
  • 1,460
  • 1
  • 21
  • 16
1

I run flutter clean within the same terminal of my flutter project and that seems to work out

1

For me, downgrading from 3.0.0 to 2.10.5 required pretty much all the solutions in this thread, and it worked.

Steps I followed,

  1. rm -rf <path to flutter repo>/bin/cache
  2. flutter doctor -v
  3. flutter clean
  4. flutter pub get
  5. flutter pub cache repair
  6. cd in ios directory in the project and pod install

Steps 5 & 6 were probably wasn't necessary but I did it anyway. Step 6 is executed at flutter run anyway.

Atul Kumar
  • 147
  • 3
  • 10
0

Run the following commands in the terminal inside the project directory

  1. flutter clean
  2. flutter pub get
Daniel Sogbey
  • 163
  • 1
  • 11
0

For me it was necessary to delete "flutter/bin/cache/flutter_tools.stamp". https://github.com/flutter/flutter/issues/67222

maxmitz
  • 258
  • 1
  • 4
  • 17