To set up flutter you need to install a
gzip binary as clear uses
pigz as an alias for this which causes issues with the
pub command due to the streaming requirement.
To work around this issue I simply grabbed the http://ftp.gnu.org/gnu/gzip/gzip-1.10.tar.gz source and built it via the usual
make commands (NOTE no need to
make install) simply grab the gzip binary and put it somewhere “common” I moved it to my
$HOME/.bin folder. Then throw this dir in front of your current path (export
PATH=$HOME/.bin:$PATH) Then you should be able to simply
git clone https://github.com/flutter/flutter.git (or download as per steps 1 & 2 of the install instructions) and follow step 3+ of the instructions at https://flutter.dev/docs/get-started/install/linux.
To start with I installed:
java-basic as java 8 and kvm are required to run the sdk tools & emulator. (dont forget to add yourself to the kvm group!)
Now this is where it gets hairy… (TLDR don’t install your IDE using flatpak as it looks like is your desire - smart! but im not sure how to install vscode but it looks as though they provide a deb, rpm and tar.gz option so I imagine unzipping the tgz version might be all you need)
As I mostly do java work, I naviely installed Intellij IDEA through the package manager (this is then installed via flatpak much like vscode I imagine).
With the android plugin this made installing the android SDK a breeze but alas 2 issues had to be tracked down.
a) ‘/dev/kvm’ was being reported as not available preventing me from starting (but not creating) an android device image. To rectify this I need to update the applications
.desktop file as such:
bjc@bjc-xps~ $ cat .local/share/flatpak/exports/share/applications/com.jetbrains.IntelliJ-IDEA-Community.desktop
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --device=kvm --command=idea com.jetbrains.IntelliJ-IDEA-Community
GenericName=Capable and Ergonomic Java IDE
Name=IntelliJ IDEA Community
Specifically I added the
b) Because Intellij was installed using flatpak (and now comes with java 11) I needed to install the ‘openjdk 8 sdk extension’ (this might be intellij specific) also note there are 2 of them with the same name and only 1 of them seems to expose the sdk correctly to intellji at
/usr/lib/sdk/openjdk8/jvm/java-8-openjdk). Now the down side to this is that the certificate stores are not correctly exposed via flatpak (h ttps://github.com/flathub/org.freedesktop.Sdk.Extension.openjdk10/issues/4).
So I had to seed my projects outside of intellij (simply running
./gradlew build) in the ‘android’ dir of a flutter project will downloaded gradle & required dependencies which avoids the java ssl issues from intellij.
From here I was able to develop/debug my flutter app from within intellj.
Hope this helps or at least can be amended for vscode.