Android Command line tools only

Hi there.

I’d like to avoid Android Studio (size, bloated, etc), and it’s possible to build Android projects just with the command line (actually its all we use on every platform).

I remember in 2015 with ant scripts this was feasible. Wondering if anyone has tests, pointers, directions, offroad charts… Something like what @kkirbatski suggests was possible in earlier versions of of-android, circa 14, 15:

This message is a bump of How to command-line build of_v0.10.1_android_release and Linux android command-line build (ant? make?) - #2 by nunos, mods please excuse if this is considered littering.

Thank you.


If you use the project generator, you should just be able to run ./gradlew assembleRelease and it’ll compile and package your project.

Thanks. I have figured that part out. But it still doesn’t work. Neither does latest Android studio, or even from an old 3.1.2 Android studio setup I had where it all worked.

The gradle script is impressive and all functionality is already there. ./gradlew tasks

Build tasks
androidArm64Debug - Assembles AndroidBinary 'android:arm64Debug'.
androidArm64Release - Assembles AndroidBinary 'android:arm64Release'.
androidArm7Debug - Assembles AndroidBinary 'android:arm7Debug'.
androidArm7Release - Assembles AndroidBinary 'android:arm7Release'.
androidDebug - Assembles AndroidBinary 'android:debug'.
androidRelease - Assembles AndroidBinary 'android:release'.
androidX86Debug - Assembles AndroidBinary 'android:x86Debug'.
androidX86Release - Assembles AndroidBinary 'android:x86Release'.
assemble - Assembles all variants of all applications and secondary packages.
assembleAndroidTest - Assembles all the Test applications.
assembleArm64 - Assembles all Arm64 builds.
assembleArm64Debug - Assembles all arm64Debug builds.
assembleArm64Release - Assembles all arm64Release builds.
assembleArm7 - Assembles all Arm7 builds.
assembleArm7Debug - Assembles all arm7Debug builds.
assembleArm7Release - Assembles all arm7Release builds.
assembleDebug - Assembles all Debug builds.
assembleRelease - Assembles all Release builds.
assembleX86 - Assembles all X86 builds.
assembleX86Debug - Assembles all x86Debug builds.
assembleX86Release - Assembles all x86Release builds.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
clean - Deletes the build directory.
cleanBuildCache - Deletes the build cache directory.
extractDebugAnnotations - Extracts Android annotations for the debug variant into the archive file
extractReleaseAnnotations - Extracts Android annotations for the release variant into the archive file
mockableAndroidJar - Creates a version of android.jar that's suitable for unit tests.

But it fails on my systems, my older machine with a working setup broke, and now from manjaro, I always end up with errors on the making part of the project.

./gradlew task androidX86Debug

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':openFrameworksProject:compileOpenFrameworksLibX86DebugX86StaticLibraryOpenFrameworksLibX86DebugX86StaticLibraryMainCpp'.
> No tool chain is available to build for platform 'x86':
    - Tool chain 'ndk-clang' (Clang): Could not determine Clang version: failed to execute clang -dM -E -.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


Total time: 2.87 secs

The toolchains are in the NDK 15rc folder, but somehow the system is not finding them.
ls ./ndk-bundle/toolchains/
aarch64-linux-android-4.9 mips64el-linux-android-4.9 x86-4.9
arm-linux-androideabi-4.9 mipsel-linux-android-4.9 x86_64-4.9
llvm renderscript

I’ve already seen this is the kind of error reported here Android Development on Linux 20.04?

Unfortunately I don’t have a mac to workaround the situation,

Any help in getting OF-Android compilation going on linux is really helpful.