How to use a specific version of flutter for build apk, when i have 2 version of flutter install?

Viewed 186

So i am installing both version of flutter, version 2 and, 1.22.6 , i want to build apk for my 1.22.6 project, but flutter automatically call the version 2 for building apk, this create error, what should i do?

4 Answers

I also faced same problem in the past. So what I did was, I downloaded both versions of flutter say (flutter2.2 and flutter1.22). And I have kept them in same folder. Now if I want to use flutter 2.2 then I'll rename "flutter2.2" folder to "flutter" and If I want to use flutter1.2 then I'll rename the "flutter1.2" folder to "flutter"

In the environment variable path I have set the path to "flutter/bin" so if I rename flutter2.2 to flutter then my environment variable will automatically take 2.2 version.

You may need to restart your PC after changing the version.

The simple way is: Download the version of Flutter you need and put it in the place where Flutter is installed In this directory you have "flutter" folder. In Ubuntu, it is usually located in this path: /home/username/development/flutter To develop the software with the desired version, just change the desired folder name to "flutter". For example : flutter --> flutter-2.x.x flutter-3.x.x ---> flutter

Related