Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fontenele/8ababe9f7aa69bd5d196f33b37f4d8eb to your computer and use it in GitHub Desktop.
Save fontenele/8ababe9f7aa69bd5d196f33b37f4d8eb to your computer and use it in GitHub Desktop.
Steps for getting a working Linux install for React Native Android

Installing React Native Android on Ubuntu

Here are the steps for getting a working Linux install for React Native:

  1. Install Java SDK
  1. Install KVM

    • sudo apt-get install qemu-kvm libvirt-bin bridge-utils virt-manager
    • sudo adduser $USER libvirtd
    • virsh -c qemu:///system list should show you an empty list.
  2. Install the Android SDK

  • Download here or use cd ~ && wget https://dl.google.com/dl/android/studio/ide-zips/2.3.2.0/android-studio-ide-162.3934792-linux.zip
  • Run unzip android-studio-ide-162.3934792-linux.zip
  • Run cd cd android-studio/
  • Run ./bin/studio.sh and follow the installer instructions
  • After it finishes installing, you'll have an Android folder in your home directory.
  • Create the following entries in your ~/.bashrc or ~/.zshrc
    • export ANDROID_HOME=/home/$USER/Android/Sdk
    • alias android='/home/$USER/Android/Sdk/tools/android'
    • reload your shell

Tip: To make Android Studio available in your list of applications, select Tools > Create Desktop Entry from the Android Studio menu bar.

Required libraries for 64-bit machines: If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:

sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386

If you are running 64-bit Fedora, the command is:

sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
  1. Continue to step 4 in the official guide
    • Found here

    • sudo npm install -g react-native-cli

    • export PATH=${PATH}:${ANDROID_HOME}/tools && export PATH=${PATH}:${ANDROID_HOME}/platform-tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment