Introduction

While setting up React Native with expo, one may encounter this error when attempting to start the application with npm start android. This is usually as a result of incomplete or inexistent Android SDK:

Here are 2 ways to resolve this:

  1. Set up Android SDK (missing installation)

Set up Android SDK by following the official Android Developer Docs

In other cases, this could be as a result of incomplete Android setup by failing to add ANDROID_HOME to your environment which can be resolved as follows:

  1. Set ANDROID_HOME path correctly(incomplete installation)

  2. Open .bashrc:

code ~/.bashrc
  1. Set ANDROID_HOME and SDK path as follows, append to your ~/.bashrc file:
export ANDROID_HOME=${HOME}/Android/Sdk
export PATH=${ANDROID_HOME}/tools:${PATH}
export PATH=${ANDROID_HOME}/emulator:${PATH}
export PATH=${ANDROID_HOME}/platform-tools:${PATH}

This resolves the error by updating you environment with the correct path of installation of Android sdk, tools, emulator etc.


Found this article helpful? You may follow me on Twitter where I tweet about interesting topics on software development.