This project aims to migrate the Flutter SDK to RISC-V Architecture. Below is a preliminary tutorial on how to do it on your local machine. Please do let me know if there any issues by creating issues on Github. I will try my best to fix any issues that may arise.
- A RISC-V Machine (Virtual Machine also works)
- A stable internet connection
- At least 20GB of storage
Right now, this is just a preliminary build and not everything works. Certain commands are tested and are working correctly while some are not. Commands that are not listed here and currently not tested. If you run into any issues, please do let me know. :) Thanks!
flutter helpflutter doctorflutter channelflutter cleanflutter createflutter pub
Tested and works
flutter run
flutter run would run into an error due to an unmatched version of Dart SDK and Flutter SDK. I will post an updated version of the precompiled Dart SDK when I resolve this issue. Please repeat step 2 and step 5 in the tutorial below and run this command again when I post the update.
Please follow the steps below in order for Flutter SDK to run correctly.
Currently, I have only tested this with Flutter SDK version 3.24.0. It is recommended that you use this version. But feel free to test this method on other versions as well.
wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.2-stable.tar.xz
tar -xvJf flutter_linux_3.24.2-stable.tar.xz
BTW, if any dependencies are missing, go ahead and get them installed and then run the commands again.
This is a precompiled Dart SDK for RISC-V. You can also try to make your own. I'll post some tutorials on that pretty soon.
git clone https://github.com/JackWangCA/Flutter-on-RISCV.git
Go into your path and add flutter/bin, this makes sure that Flutter commands are recognized. It would also be a good idea to add dart-sdk/bin to your path as well.
Run any flutter command so it downloads the Dart SDK files that it needs. Ex. flutter doctor
Now go ahead and replace the Dart SDK in the Flutter SDK with the one that you have just downloaded by running these commands
cp -r /root/dart-sdk/bin/* /root/flutter/bin/cache/dart-sdk/bin/
cp -r /root/dart-sdk/dart /root/flutter/bin/
If the paths to the SDKs are different on your machine, please make the respective changes to the commands above.
Now you should be able to run Flutter commands. There may still be dependencies that you may need ton install but not listed here. Please go ahead and install them and run the commands that failed again.