Skip to content

Instantly share code, notes, and snippets.

@ionut-movila
Created May 23, 2018 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ionut-movila/2e20565288e58d32277aa5df3b20d9b2 to your computer and use it in GitHub Desktop.
Save ionut-movila/2e20565288e58d32277aa5df3b20d9b2 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Reverts the Android NDK version to r16b from r17 to resolve a react native compile issue:
# https://github.com/facebook/react-native/issues/19321
# https://github.com/android-ndk/ndk/issues/700
set -ex # sensitive on errors and with more logs!
# set env vars
export ANDROID_NDK_VERSION='r16b'
# create a temp working directory
mkdir ./android-ndk-tmp
cd ./android-ndk-tmp
# download ndk
wget -q https://dl.google.com/android/repository/android-ndk-$ANDROID_NDK_VERSION-darwin-x86_64.zip
# uncompress
unzip -o android-ndk-$ANDROID_NDK_VERSION-darwin-x86_64.zip
# move to its final location
rm -rf $ANDROID_HOME/ndk-bundle/*
cp -rf ./android-ndk-$ANDROID_NDK_VERSION/* $ANDROID_HOME/ndk-bundle
ls -la $ANDROID_HOME/ndk-bundle/toolchains/mipsel-linux-android-4.9/prebuilt/darwin-x86_64/bin
# remove temp dir
cd ..
rm -rf ./android-ndk-tmp
# add to PATH
export PATH=${PATH}:$ANDROID_HOME/ndk-bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment