How to setup Flutter Engine Development Environment on Ubuntu / Linux ?

The Flutter Engine is a portable runtime for hosting Flutter applications. It implements Flutter’s core libraries, including animation and graphics, file and network I/O, accessibility support, plugin architecture, and a Dart runtime and compile toolchain. You may read more about flutter & flutter Engine at our post “What is Flutter and Flutter Engine ?”

Dependency for starting Flutter Engine development

  1. Create SSH Keys as mentioned at “How to create SSH Keys in Ubuntu / Linux”
  2. Login to your github account and Open https://github.com/flutter/engine
  3. Fork the engine repository as shown below,
fork-flutter-engine

4. Add your ssh public as created in step 4 to your github account as mentioned in “Adding a new SSH key to your GitHub account”

5. Download and install depot_tools as mentioned in “How to install Chromium depot_tools on Ubuntu / Linux”

6. You have git, python, ssh installed.

$ sudo apt-get install git python ssh

Download Flutter Engine Source Code and Setup

Create an empty directory for your copy of the repository. For best results, call it "engine” some of the tools assume this name when working across repositories.

$ cd workspace
$ mkdir engine
 $ cd workspace 
 $ mkdir engine 

Create a .gclient file in the engine directory with the following contents, replacing <your_name_here> with your GitHub account name:

solutions = [
  {
    "managed": False,
    "name": "src/flutter",
    "url": "git@github.com:<your_name_here>/engine.git",
    "custom_deps": {},
    "deps_file": "DEPS",
    "safesync_url": "",
  },
]
$ cd engine
engine $ gclient sync
Syncing projects: 100% (95/95), done.
Hook '/usr/bin/python src/tools/buildtools/update.py' took 741.97 secs
Running hooks: 100% (7/7), done.

The command “gclient sync” may take some time depending upon your machine configuration and network speed, be patient and wait for it to complete as seen above,

$ cd src/flutter
$ git remote add upstream git@github.com:flutter/engine.git
$ cd ..
$ sudo ./build/install-build-deps-android.sh

Wait for this command to be completed,

$ sudo ./build/install-build-deps.sh
$ sudo ./flutter/build/install-build-deps-linux-desktop.sh
$ git remote rename origin upstream
$ git remote add origin git@github.com:<your_name_here>/buildroot.git

Leave a Comment