How to build an app without the non-free Android SDK?

I have recently written an app, but I can’t build it because I need the Android SDK. I don’t want to use it though because I’ve heard it may not be free or fully open source.

Anyway when I try to build it with gradlew, I get an error saying:

SDK location not found. Define location with sdk.dir in the file or with an ANDROID_HOME environment variable.

Since I don’t have a folder containing the SDK I obviously can’t provide the directory.

I have read about efforts to provide free builds of the SDK by figuring out how to building them from source on the blog at some point.
Is that a thing now? Is there a drop in replacement for the Android SDK that I can download into a folder which I can then use in the sdk.dir or ANDROID_HOME variable?

Surely I can’t be the only one in the community with this problem, right?

I’m on Linux (Fedora) btw.

The free builds discussion can be found in this forum thread, which was mentioned in this thread about the NDK.

If you were using Debian, you could use the packages for the SDK. Perhaps you could run a Debian chroot and use the SDK from within it.

1 Like

Thanks for the quick reply @davidb.

Not sure what NDK is. I think I need the SDK though.
The first thread you mentioned appears to be locked so it’s hard to say (or ask) how far they’ve come.

I’m not familiar with chroot, but setting up a Docker container would be a nice solution.
Do you happen to know if someone has created such a Docker image already?

NDK is the Native Development Kit for non-Java, low-level code.

Perhaps Docker is part of the approach used for the Android-Free packages repository. See also the Android Rebuilds page linked to from that repository.

You could perhaps send a mail to the address on the Android Rebuilds page.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.