Skip to content

Instantly share code, notes, and snippets.

@tiagofer
Last active November 21, 2017 21:43
Show Gist options
  • Save tiagofer/4508872f2d6fe390a12e43059a1ae848 to your computer and use it in GitHub Desktop.
Save tiagofer/4508872f2d6fe390a12e43059a1ae848 to your computer and use it in GitHub Desktop.
Build a Android module on Godot Engine
#Install Ubuntu for windows on Microsoft Store
#Path: https://www.microsoft.com/pt-br/store/p/ubuntu/9nblggh4msv6
# Install Oracle JDK 8
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
apt-get install -y unzip make
#Install Linux dependecies
apt-get install build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev \
libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libssl-dev libudev-dev \
libxrandr-dev
# Get SDK tools (link from https://developer.android.com/studio/index.html#downloads)
wget https://dl.google.com/android/android-sdk_r23-linux.tgz
tar xf android-sdk*-linux.tgz
# Get NDK (https://developer.android.com/ndk/downloads/index.html)
wget https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
uznip android-ndk*.zip
# Let it update itself and install some stuff
cd android-sdk-linux/tools
./android update sdk --no-ui
#Edit enviroment variables
nano ~/.bashrc
#Add code in the bashrc
export ANDROID_HOME=$HOME/android-sdk-linux
export ANDROID_NDK_ROOT=$HOME/android-ndk-r13b
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/27.0.1:$ANDROID_NDK_ROOT
#In the godot path run the code
scons
#if list android in the options, it`s ok.
"The following were detected:
android
haiku
server
x11"
#run
scons p=android target="release_debug or release"
#in the bashrc exchange NDK_ROOT for NDK_HOME in the two cases
#go to godot/platform/android/java
#edit build.gradle switching "buildToolsVersion "26.0.1"" for your build version
#run
./gradlew build
#go to godot/bin and take your module compiled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment