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

8,280

Solution 1

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

Solution 2

For me had to comment out sdk part like so:

dev_dependencies:
  integration_test:
   # sdk: flutter

Solution 3

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.

Solution 4

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.

Share:
8,280
Mohamed AbdelraZek
Author by

Mohamed AbdelraZek

Experienced Mobile Developer with a demonstrated history of working in the computer software industry. Skilled in Android Development, Java, Kotlin and Swift. Strong engineering professional with a Bachelor of Computer Science focused on Computer Science.

Updated on December 26, 2022

Comments

  • Mohamed AbdelraZek
    Mohamed AbdelraZek over 1 year

    I have an app, it is very simple and I keep getting this error:

    pub get failed (server unavailable) -- attempting retry 1 in 1 second... Because bascis depends on integration_test any from sdk which doesn't exist (could not find package integration_test in the Flutter SDK), version solving failed.

    I have tried

    Pup upgrade, Pub get.

    How can I get rid of this error?