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
You can create alias for Flutter and point to different version for example flutter will call flutter 1.22.6 flutterd will call flutter 2 instead
so when you want to build for 1.22.6 just use flutter I have write a article, sadly in Thai not translate yet, how to have 2 different version of Flutter and how to make alias to call different version here
so after you this, you can just run flutter build
Comments
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.
Comments
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