I am trying to get my device to connect to android studio so I can run the app through my phone, but it doesn't show up. I have used flutter doctor and this is the output I get :

I am trying to get my device to connect to android studio so I can run the app through my phone, but it doesn't show up. I have used flutter doctor and this is the output I get :

For me, I was able to solve the issue by following this solution
the solution is all about telling flutter where is android sdk located by running the following command
> flutter config --android-sdk <YOUR_SDK_PATH>
I'm using Ubuntu 18
Try the following for the first error:
1.) Did you run the command it suggested?
flutter doctor --android-licenses
2.) Upgrade Android Studio
For the connected device error try the following:
1.) Run flutter devices this command is used to verify that Flutter recognizes your Android device which should be connected,
2.) Enable Developer mode on your phone and USB debugging on your device
3.) Using a USB cable plug your phone into the computer and if prompted make sure you authenticate your computer to access the device
4.) Try flutter devices again and see what happens
In my case, I was using a Canary version of Android Studio (e.g Android Studio Bumblebee | 2021.1.1 Canary 2), so I had to swap to using Android Studio Arctic Fox | 2020.3.1 Beta 4.
If you go into Preferences > Plugins, you may get the warning:
Incompatible: requires IDE build 203.7717.56 or older