General Questions

What is mkapk?

mkapk is a lightweight Android build tool designed for Termux. It allows you to compile Android apps (APKs) directly on your Android device without the overhead of cross-compilation. It supports Java, Kotlin, C++, C, and other languages through an extensible plugin system.

Can I use mkapk on iOS or Windows?

mkapk is designed specifically for Termux on Android and may not work on other platforms. It relies on Android-specific paths and tools that are only available in Termux.

Is mkapk free?

Yes, mkapk is free and source-available (not open-source). You can view the source code on GitHub and contribute to the project via Issues.

Installation & Setup

What are the minimum storage requirements?

mkapk itself is relatively small (~730KB), but you need storage for:

  • Android SDK and OpenJDK: ~1-2 GB.
  • Your projects: Varies by size.
  • Plugin Languages: Varies by size.

A minimum of 1-3 GB free storage is recommended.

How do I update mkapk?

Building & Compilation

How long does it take to build an APK?

Build time depends on project size and device specifications:

  • Small project (first build): 124-150 seconds
  • Small project (incremental): 5-10 seconds
  • Large project: 2-5+ minutes

mkapk uses incremental compilation to speed up subsequent builds dramatically.

What's the difference between debug and release builds?

Debug builds: Include debugging symbols, unoptimized, faster to build, larger file size.

Release builds: Optimized, obfuscated (R8), signed, smaller file size, slower to build.

Use debug for development and release for distribution.

How do I build for multiple architectures?

Use the -ndk-all flag to build for all supported architectures:

mkapk build -ndk-all

This creates split APKs for armv7, arm64, x86, and x86_64, plus a universal APK.

Can I use C++ with mkapk?

Yes! mkapk supports C++ (and C) through native compilation. Configure native targets in config.json and write your C++ code in the src/C++ directory. See the Advanced Guide for details.

What languages does mkapk support?

Built-in support: Java, Kotlin, C, C++

Through plugins: Any language which compiles to JVM bytecode or machine code, via the plugin system.

Performance & Optimization

Can I use R8 obfuscation?

Yes! mkapk automatically uses R8 (successor to ProGuard) for release builds. Provide ProGuard rules in proguard-rules.pro or disable obfuscation with -no-obs flag.

How can I reduce APK size?

Several techniques:

  • Use release builds with R8 optimization
  • Build architecture-specific APKs instead of universal
  • Minimize dependencies and unused resources

Troubleshooting & Issues

Build fails with "missing android.jar"

Ensure your SDK_ROOT and TARGET_SDK are correctly set in config.json.

What if the JVM daemon crashes?

mkapk automatically restarts the daemon. If issues persist, run mkapk clean to reset build state and try again.

How do I view detailed build logs?

Build logs are printed to the console. For detailed compilation output, check the individual tool outputs.

Plugins & Extensions

How to install plugins ?

Yes! mkapk has an extensible plugin system. See the Plugin Reposirory for detailed instructions on creating and signing plugins.

Are plugins secure?

Yes, mkapk uses cryptographic verification (SHA256 + RSA) to ensure plugin integrity. Only signed plugins from trusted sources should be installed.