Resolving "cmdline-tools component is missing" in Ubuntu 24.04 with VisualStudio for Flutter Development

 I've recently been trying to switch from working mainly in Windows to working mainly in Linux, mostly because I'm currently running Windows 10, and would have to completely rebuild my PC in order to upgrade to Windows 11. My PC works just fine, and runs Ubuntu great. 

That being said, I've ran into a few snags getting Flutter working on Ubuntu. Following the generic tutorials from the Flutter Docs (here) got me most of the way there. 
The problem I ran into stems from (I think) the fact that Ubuntu switched from .deb packages to these things called SNAPS, which are self-contained apps. When searching for resolutions for specific problems, most of the online source has information that's now outdated. 

That brings me to my issue. When I ran Flutter Doctor, I got an error complaining that the android "cmdline-tools component is missing"



After much googling without luck, mostly showing me those "type this nonsense into your terminal", I found the answer. You install the cmdline-tools directly inside Android Studio.

Open android studio, and go to the SDK manager. It's located under the gear icon on the right side of the page.




Then click on "SDK Tools", and find the "Android SDK Command-line Tools(latest)" entry, and click the checkbox. 


Click "Apply" and let it download and install. 

Once it's finished, go back to your Visual Studio terminal, and run flutter doctor


You'll probably now get "Some Android Licences not accepted. To resolve this, run flutter-doctor --android-licenses", which you literally just run in that same terminal. 

Then re-run flutter doctor.




I hope that helped you!
Happy Coding!
~Tom





Comments

Popular posts from this blog

Organize your Arduino code with header and class files

Using GIT with Arduino

Programming Arduino with Regular Expressions