Installation Issues
Error: "command not found: mkapk"
Causes: Binary not installed or not in PATH
Solutions:
- Verify installation:
which mkapk - If empty, reinstall:
dpkg --install ./mkapk-aarch64.deb - Check permissions:
chmod +x $PREFIX/bin/mkapk
Error: "Missing dependency: openjdk-21"
Solution: Install OpenJDK 21
apt install openjdk-21 -y
Then verify:
java -version
Error: "Permission denied" when running mkapk
Solution: Add execute permission to binary
chmod +x $PREFIX/bin/mkapk
Build Errors
Error: "config.json not found"
Cause: Project not initialized
Solution: Initialize project first
mkapk init
Then configure config.json with your project settings.
Error: "Architecture Build Error: android.jar not found"
Cause: SDK_ROOT or TARGET_SDK incorrectly configured
Solution: Fix config.json
{
"SDK_ROOT": "/path/to/android-sdk",
"TARGET_SDK": "34"
}
Verify the path exists:
ls ~/android-sdk/platforms/android-34/android.jar
Error: "Linking failed for libname.so"
Cause: Native linking error (missing symbols, wrong ABI)
Solutions:
- Check for missing dependencies in EXTRA_FLAGS:
"EXTRA_FLAGS": ["-lm", "-ldl"] - Verify all source files are included
- Check C++ flags are correct:
"EXTRA_FLAGS": ["-std=c++17", "-fexceptions"]
Error: "ApkSigner runtime verification failed"
Cause: Keystore issues (wrong password, missing alias, corrupted file)
Solutions:
- For debug builds, mkapk creates debug.keystore automatically
- For release, verify keystore exists:
keytool -list -v -keystore ~/my-release.keystore - Check config.json KEYSTORE_ALIAS matches actual alias
- If corrupted, recreate keystore (this will invalidate old signatures)
APK Issues
Issue: "Unable to load native library" error
Cause: Native library missing or wrong ABI
Solutions:
- Verify library compiled for correct ABI:
file lib/arm64-v8a/libmylib.so - Match device ABI:
adb shell getprop ro.product.cpu.abi - Build for correct ABI:
mkapk build -arch aarch64-linux-android - Check library is included in APK:
unzip -l MyApp.apk | grep .so
State & Cache Issues
Issue: Build fails after deleting a file
Solution: Clean and rebuild
mkapk clean
mkapk build
This resets the incremental build cache.
Getting Help
If you can't resolve your issue:
- Check the FAQ for common questions
- Search GitHub Issues
- Open a new issue with:
- Full error message
- config.json (sanitized)
- Device info:
uname -a, Android version - Termux version:
termux-info - Steps to reproduce