This article has participated in the “Digitalstar Project” and won a creative gift package to challenge the creative incentive money.

First download termux open and wait for initialization to complete as shown

Download the helper first

pkg install git

pkg install wget

pkg install curl

pkg install kona

pkg install bsdtar

Then download Arch Linux copy the following script to your terminal and execute it

wget https://github.com/SDRausty/TermuxArch/raw/master/setupTermuxArch.bash && bash setupTermuxArch.bash
Copy the code

Success process as shown in figure

Type in Linux and download the package. If you don’t download these three packages, the picture will look like this

startarch
Copy the code

Installation failed. Procedure Take it one at a time

pacman -S unzip

Copy the code
pacman -S zip
Copy the code
pacman-key --init && pacman-key --populate archlinuxarm
Copy the code

Then install the sdkman

The curl -s "https://get.sdkman.io" | bashCopy the code

Open the sdkman

source "/root/.sdkman/bin/sdkman-init.sh"
Copy the code

Check the version. The current installed version will be displayed after input

sdk version
Copy the code

Download Gradlesdk \ in sdkman

sdk install gradle
Copy the code

Create this favorite folder and then go back to Linux and install the JDK inside and this is the arm64 download unzip

wget https://github.com/VcotyQin/TermuxWithGradle/raw/master/jdk8_arm64/jdk-8u221-linux-arm64-vfp-hflt.tar.gz && tar xzvf jdk-8u221-linux-arm64-vfp-hflt.tar.gz
Copy the code

Then download the editor

pacman -S vim
Copy the code

Configure environment variable execution

vim /etc/profile

Copy the code

Enter I inside the line edit slide to the bottom of the input

Set Java environment export JAVA_HOME=# /jdk1.8.0_241 export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin export JRE_hOME=$JAVA_HOME/jreCopy the code

To save, press ESC, enter :wq + press source

source /etc/profile
Copy the code

Typing Java verifies that the pairing is successful

Create a directory under Linux to install the Android SDK Tools

mkdir android_sdk && cd android_sdk && wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip && unzip sdk-tools-linux-4333796.zip
Copy the code

You are advised to copy the link from the official website to configure environment variables and run them in Linux

vim /etc/profile
Copy the code

Type I and slide to the bottom and paste the code below

Export ANDROID_HOME = / data/data/com termux/files/home/android_sdk # SDK is this PATH export PATH = $ANDROID_HOME/tools: $PATHexport PATH=$ANDROID_HOME/tools/bin:$PATHexport PATH=$ANDROID_HOME/platform-tools:$PATHCopy the code

Save and exit etc; Wq go ahead

source /etc/profile

Then use sdkManager to install build-tools, platform-tools, and Platforms

Open mode of sdkManager

Source "$HOME/.sdkman/bin/sdkman-init.sh" // or source "/root/.sdkman/bin/sdkman-init.sh"Copy the code
sdkmanager "platform-tools" "build-tools; 29.0.3 "" platforms; android-29"Copy the code

Adapter termux

wget https://raw.githubusercontent.com/VcotyQin/TermuxWithGradle/master/adaptTermuxARM64.sh && chmod 777 adaptTermuxARM64.sh && ./adaptTermuxARM64.sh
Copy the code

Overwrite aAPT, AAPT2 into the path of the CD Androidsdk under android_sdk/build-tools/

CD 29.0.2

Input the l

rm -rf aapt

rm -rf aapt2\

wget https://raw.githubusercontent.com/VcotyQin/TermuxWithGradle/master/aapt/arm64/aapt
Copy the code
wget https://raw.githubusercontent.com/VcotyQin/TermuxWithGradle/master/aapt/arm64/aapt2
Copy the code

Download and then give permission

chmod 755 aapt
Copy the code
chmod 755 aapt2
Copy the code

Finally, install glibc

pacman -S glibc
Copy the code

Setup complete!

Run gradle build by compiling CD to gradle path

You can start compiling