skip to Main Content

I have updated flutter and dart to latest version.
dart –version shows following output:
Dart SDK version: 2.14.4 (stable) (Wed Oct 13 11:11:32 2021 +0200) on "windows_x64"

Yet while running pub.get in android studio reports error with older version of dart-sdk
enter image description here

Here is a portion of my pubspec.yaml:
enter image description here
How to resolve this?

3

Answers


  1. It means that your Dart SDK version does not match the Firebase minimum required version. You can try to update your SDK or the longer and more stable option is checking all the minSdkVersions if they are under the required version or not.

    You can simply search in project "minSdkVersion" and if you see flutter.minSdkVersion or something like this, manually change the version the one you need. Like 10 or something you need.

    And try not to forget to upgrade newest Flutter version. This way you can never be under the required minSdkVersions.

    Login or Signup to reply.
  2. Go to your Android Studio settings and search for Dart SDK path and change it to the location your updated Flutter is.

    Also, make sure you don’t have multiple Flutter versions installed on your system.

    Login or Signup to reply.
  3. In my case I had upgraded to new flutter version by command it did but I had more than one sdks the issue is to solve you have to replace the sdks path in android studio (languages and frameworks) of flutter and dart both to newer version, to find new version simply command in terminal (which flutter or which dart) on your preferences.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search