Build android apk from command line without gradle

submited by
Style Pass
2024-05-18 23:30:07

This is post is similar to the one about building flutter but a bit different. Actually this one was written a few years prior to writing flutter version but just never got published. Since then some steps has changed and I moved to Java 11. But you if you still build with java 8 old build method is still surprisingly functional.

So the idea is to build and APK file which then can be installed on an android phone without using gradle and doing each step “manually”. If you are building regular android apps with Java/Kotlin then this is pointless. But it has a bit more sense when you are building game like apps with C/C++. But the most important thing is just to learn how this build process is working, what are its parts and how they stack together.

Let’s start with building very small android app without any help of build tool. For the initial android build we need only 2 files: MainActivity.cpp, AndroidManifest.xml. These should be enough to build the apk. We will need one more file keystore.jks to build to sign the apk so that android will allow us to install the apk on the device.

Leave a Comment