How To Install VS Code on Raspberry Pi 4 - Two of Three

Описание к видео How To Install VS Code on Raspberry Pi 4 - Two of Three

All videos are in 4K so you may need to change your YouTube Quality settings to 1080p HD if the screen details are blurry.

This is part two of the series about how to install and run flutter apps on a Raspberry Pi 4. This video shows you how to install VS Code and update Ninja Build so that we can build and run the apps.

Time Line:
0:00 to 0:20 check Snap, Flutter and Dart are installed (previous video shows how to).
0:21 to 2:02 install VS Code.
2:03 to 2:15 launch VS Code from the Pi desktop.
2:16 to 4:58 how to create a new Flutter app project in VS Code.
4:59 to 5:13 check to make sure that the Linux device (what we will run the app on) is installed.
5:14 to end remove, purge, install and check version for Ninja Build.

How to setup Flutter, VS Code and run the Flutter default test application on a Raspberry Pi 4 with 2G of ram.

Step 1. Using the Raspberry Pi imager, select the Debian 11 Bullseye 64 bit and install on the Raspberry Pi with at least 2G of ram. Does not work on the default Linux 32 bit distribution.

Step 2. After installation is complete, follow the command line instructions for installing snap and then Flutter. https://lnkd.in/g9gDtiyj

Step 3. Install VS Code using the Linux .deb download. https://lnkd.in/gXKYy324

Step 4. Follow the instructions on this link to set up Flutter and Dart in VS Code. https://lnkd.in/gEVN-3zm

Step 5. The final instruction on the docs.flutter link above is to run flutter doctor. This will download some files and may take a while. There will be some errors (missing Android stuff and Chrome) but unless it is something else it has nothing to do with what we are working on.

Step 6. Assuming the installation of Flutter/Dart and VS Code is okay: this link explains how to test drive the VS Code and Flutter installation by creating the standard Flutter test project. https://lnkd.in/g_V3Ncku

Step 7. After this project is setup DO NOT try to build, run it or debug it in the VS Code IDE. Not sure why but it hangs up - may be due to lack of memory.

Step 8. Close VS Code, find your developer directory for the test project, open it up in terminal. At the command line: run flutter clean and then flutter pub get and in that order. Not necessary but does some house cleaning avoid issues . . .

Step 9. In the terminal window, assuming you are in the Flutter example starter project root directory, type in this command:

flutter build linux --target-platform linux-arm64 -v

Step 10. the -v allows verbose logging so you can see if it hangs up. I get a random hang at when it runs the ninja build. If it hangs up there then try updating ninja.

Step 11. You will need to use one of the various Linux keystrokes (ALT with Print Screen key and then O) to get out of a crash if it hangs up at the ninja step. After a reboot and do step 12.

Step 12. Update ninja: sudo apt-get update and then sudo apt-get install ninja-build. You may need to uninstall and reinstall.

Step 13. Again DO NOT build in VS Code terminal - for some reason, probably lack of memory, the system will hang at the ninja build step.

Step 14. After you have a successful build (at the command line and not in VS Cod): navigate over from your project directory to build/linux/arm64/release/bundle and you will find the flutter application build (the default name is flutter_application_1 or whatever name you gave the project).

Step 15. You can use ./ and the file name to run the app from the command line or you can use the desktop and double click and run that way.

Step 16. I have run the app successfully - next steps - install the GPIO packages and write an app to flash and LED!

Note that if I use terminal to build and run it seems fairly stable.

Комментарии

Информация по комментариям в разработке