Unable to build Linux desktop apps when VS Code is installed via Flatpak
See original GitHub issueDescribe the bug
I created the test application which counts the number of times you press a button, using the VSCode flutter extension. Then I pressed F5 to build and run the project and get this error
CMake Error at CMakeLists.txt:3 (project):
The CMAKE_CXX_COMPILER:
/usr/bin/clang++ is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
Exception: Unable to generate build files
Yet if I go to the project folder in a bash shell and type flutter run -d linux
I get this output and the project runs fine.
Launching lib/main.dart on Linux in debug mode...
Building Linux application...
Syncing files to device Linux... 100ms
Flutter run key commands.
r Hot reload. 🔥🔥🔥R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
💪 Running with sound null safety 💪
An Observatory debugger and profiler on Linux is available at: http://127.0.0.1:38865/EcLD24T3ZEI=/
The Flutter DevTools debugger and profiler on Linux is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:38865/EcLD24T3ZEI=/
To Reproduce
Steps to reproduce the behavior:
To get the VSCode build error
- press
<CTRL> + <SHIFT> + <P>
to bring up the VSCode task runner - select Flutter: New Project
- select a project folder
- give an application name
- press F5
Then to get the successful run in bash
- open bash terminal external to VSCode
- change working folder to the flutter test project folder
- execute flutter run -d linux
Expected behavior A clear and concise description of what you expected to happen.
I expect the test application to build and run in VSCode just as it does in the bash shell.
Screenshots If applicable, add screenshots to help explain your problem.
Please complete the following information:
- Operating System and version: Kubuntu 22.10
- VS Code version: 1.74.1
- Dart extension version: Dart SDK version: 2.18.6 (stable)
- Dart/Flutter SDK version: 3.3.10 • channel stable • https://github.com/flutter/flutter.git
- Target device (if the issue relates to Flutter debugging): linux
Issue Analytics
- State:
- Created 9 months ago
- Comments:18 (9 by maintainers)
Top Results From Across the Web
flatpak installed vscode's integrated terminal not having ...
(i.e. My haxe extensions in vscode can't find haxe in my path even though it is installed). Haxe is available in /usr/bin/ so...
Read more >How can I make Visual Studio Code (flatpak) see Clang or ...
How can I make Visual Studio Code (flatpak) see Clang or other apps in the system path? · Run flatpak search llvm ·...
Read more >Remote Development with Linux - Visual Studio Code
Linux Prerequisites for VS Code Remote - SSH, Dev Containers, and WSL extensions.
Read more >Developing applications using Flatpak-packaged editors/IDEs
For example, a developer is working on a Python application and wants to use Visual Studio Code (OSS version) from Flathub as his...
Read more >How To Install And Use Flatpak In Linux - OSTechNix
Flatpak is a system to build, install and run applications and runtimes on ... Steam, Spotify, and Visual studio code etc., are available...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great, glad you’ve up and running! I’ll update the title, and hopefully will remember this in future. Perhaps it’s also worth detecting this from the VS Code extension and recording it in the log somewhere (or finding a way to surface it to the user if things seem to be failing). I’ll make a note to think more about this (since a similar issue exists with Snap).
omg as you were typing that I was busy deleting the flatpak version and installing from the repo as I suddenly remembered that on my other kubuntu system I was doing exactly that.
The trigger for that memory was when I wrote my comment about vscode being installed via flatpak.
So it seems the flatpak version of vscode leaves a lot to be desired.
I came back here to say the problem is now resolved having installed from the repo.
Sorry for wasting your time, I should have realized the problem straight away, but that’s what you get when you build a new installation having been awake around 36 hours I guess mb
But at least now we know the flatpak build is broken, and that might be the first question you should ask linux users when they say things don’t work lol
Again, really sorry for wasting your time, and tyvm for being patient with me.