Please verify your Flutter configuration by running flutter config --list in the terminal. This will display the current settings and SDK configuration.
Additionally, run flutter doctor -v to check which SDK is currently being used. I encountered the same issue, and this step helped me identify the problem.