How to solve 'could not find package integration_test in the Flutter SDK' error

It is likely due to your network problem. Because the output says (server unavailable).

Ways to debug this:

  1. Try curl https://google.com to see whether your command line can connect to network.
  2. Also try, for example, curl https://flutter.dev (or, try to curl the actual url your pub get is trying to access.

This may due to, for example, your network is broken. Or because you have a broken VPN, broken proxy, etc.


For me had to comment out sdk part like so:

dev_dependencies:
  integration_test:
   # sdk: flutter

I had the same error after changing my channel from master to stable. I was able to fix it by removing (or commenting out) the following library from pubspec.yaml

dev_dependencies:
#  integration_test:
#    sdk: flutter

I experienced this when I was trying to setup a flutter web project without enabling flutter web on my PC. I enabled flutter for web and everything was okay.