Setting up Flutter without Android Studio

AUBY Khan
2 min readJul 20, 2017

--

There’s a lot of tools for cross-platform mobile development these days and if you’re someone like me, you may have setup different mobile development tools on your machine already e.g. ReactNative, Ionic, Xamarin etc. The Flutter installation guide recommends to download and install Android Studio in order to build apps for Android but there’s an easy way to build and run Flutter apps on Android emulator or device without having the need to download and install Android Studio. This is with the assumptions that you do have Android SDKs and build tools already present in your development setup.

Instructions

1. Upgrading Flutter

Upgrade flutter by running following command

flutter upgrade

After the upgrade finishes, run the flutter doctor command to make sure if everything else is ready. If you don’t have Android Studio, flutter doctor command will mention that Android Studio is not installed.

2. Installing Gradle

When you try to run a flutter project without Android Studio, you will most probably get the following error since Gradle may not be present on your system.

Finished with error: Unable to locate gradle. Please install Android Studio.

Installing Gradle on mac is fairly simple if you have homebrew installed. Just run the following command:

brew install gradle

On windows, you just need to download Gradle for Windows, copy it to a safe location and add it to your PATH variable.

3. Updating Gradle directory for Flutter

Run the following command with correct path to Gradle directory:

flutter config --gradle-dir /usr/local/opt/gradle

The path shown above for Gradle is for macOS, for Windows, use the path that you’ve installed Gradle in.

After this step, you can normally build and run Android apps on emulator or physical devices as per this guide.

--

--

AUBY Khan

Muslim | Learner | Coder | Techie | Mentor | Speaker | Partner @activemake | #GDG | #FlutterKarachi #FlutterPakistan | #Flutter #iOS #Android #Xamarin #IoT #UX