How to build Android apps without Gradle

Issue

First up, I’m totally new to the Android ecosystem and mobile app dev in general. However I am a veteran C#/C++/JS/Java app and web dev. So currently my corporate firewall has rules to prevent our work PCs from connecting online. I’m supposed to be doing android app dev fully offline. I got Android Studio installed and created a test app, however gradle refuses to build offline, even with the “Offline work” option ticked. If I build an app on my internet-connected laptop all goes fine. If I copy that app to my work PC, gradle crashes with “cannot find module XYZ in gradle cache”. I tried copying over the<user>/.gradle/caches/ dir from my laptop to my PC but that doesn’t work either.

So, I’m left with no option but to attempt to build my android project without gradle. I’d like to use the Android Studio IDE if possible, else I’d fallback to SublimeText. So my question is, how do I build, debug and emulate android apps without gradle?

Things I’ve tried:

  • Creating a hello world app on my laptop, building it and emulating it. Gradle updates all its libs and stuff, and I used the AVD Manager to download an AVD image an setup an emulator.
  • Copying over the test app project dir to my work PC
  • Copying over the updated Android SDK dir to my work PC (with the AVD image, etc)
  • Copying over the gradle caches to my work PC

Solution

At least you need internet connection once for the first build, then you can go to settings & enable offline. then you can build without the internet connection. Android Studio makes life easier. Anything other than that is going to very hard.

Answered By – Abhi Muktheeswarar

Leave a Comment