Flutter pub get Flutter version mismatch | podfile.lock flutter version mismatch

416 views Asked by At

I have updated my flutter version to 3.0.1 - Reference

I have one existing flutter project. When I hit flutter pub get command, inside ios/Flutter/Flutter.podspec file, it is showing flutter version 1.0.0.

s.version = '1.0.0'

Also in the iOS podfile.lock file is also showing flutter version 1.0.0. I tried updating pod, etc everything but same issue.

PODS:

  • Flutter (1.0.0)

Why it is showing 1.0.0 instead of 3.0.1. or this is not the correct way to check & update flutter version of existing project?

1

There are 1 answers

0
fravolt On

The flutter version depends on your environment (not the project), so you should be able to just run flutter --version to see which version you're running.

As for the project, it should normally build with any compatible flutter version. If you look at your pubspec.yaml, it should have the environment part which specifies the SDK. It should look something like the following to be compatible with the new Flutter version:

environment:
  sdk: '>=2.17.0 <3.0.0'

I think (not entirely sure, though) that the 1.0.0 that you see is the app version, as specified in the pubspec.yaml version (usually right above the environment bit).