Prerequisites
- Java SDK version 8
- Internet
- Gradle 2.14.1
- Android SDK Tools, Revision 25.3.0 (March 2017)
Download and Installing Java8
1 2 3 4 |
sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update sudo apt-get install openjdk-8-jdk sudo apt-get install openjdk-8-jre |
1 |
sudo update-alternatives --config java |
1 |
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java |
1 |
sudo update-alternatives --config javac |
1 |
There is only one alternative in link group javac (providing /usr/bin/javac): /usr/lib/jvm/java-8-openjdk-amd64/bin/javac |
1 |
sudo java -version |
Download and Installing Gradle 2.14.1
1 2 3 4 5 6 7 |
cd /opt/ wget https://services.gradle.org/distributions/gradle-2.14.1-all.zip unzip gradle-2.14.1-all.zip GRADLE_HOME=/opt/gradle-2.14.1/ PATH=$PATH:$GRADLE_HOME/bin export GRADLE_HOME export PATH |
Download and Installing Android Environment
1 2 3 4 5 |
wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip mkdir /opt/android-sdk-linux/ cp tools_r25.2.3-linux.zip /opt/android-sdk-linux/tools_r25.2.3-linux.zip cd /opt/android-sdk-linux/ unzip tools_r25.2.3-linux.zip |
Set Android enviroment to Linux PATH
1 2 3 4 5 6 7 |
ANDROID_HOME=/opt/android-sdk-linux export ANDROID_HOME export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools/bin sdkmanager "platforms;android-25" sdkmanager "platforms;android-23" sdkmanager "build-tools;23.0.3" apt-get install -y lib32stdc++6 lib32z1 |
If you want to install other packages, you can run this commmand
1 2 3 |
android update sdk --no-ui -a --filter <<INDEX>> android update sdk --no-ui -a --filter 3,5,8,14 |
If you have trouble with SSL
1 2 3 |
cd /etc/ssl/certs/java/ rm /etc/ssl/certs/java/cacerts /var/lib/dpkg/info/ca-certificates-java.postinst configure |
Build Android Project
Download / Clone YOUR ANDROID PROJECT
1 |
wget hxxp://ocongkomak.zip |
1 2 3 |
mkdir /opt/android-project mv ocongkomak.zip /opt/android-project/ocongkomak.zip cd /opt/android-project/ |
Test building your Project
1 |
gradle assembleDebug |