Troubleshoot TinyFacade AIDL integration issues — binding failures, missing models, slow inference, tool calling problems, signing mismatches. Use when a TinyFacade integration is not working.
Diagnose and fix common issues with TinyFacade AIDL client integration.
$ARGUMENTS (optional — one of: binding, models, performance, tools, signing)If an issue type is provided, jump to that section. If not, ask the user what problem they're experiencing and match it to the right section.
Symptoms: bindService() returns false, onServiceConnected never fires, app crashes on service call.
Is TinyFacade installed?
adb shell pm list packages | grep tinyfacade
Should show package:com.tinyfacade. If not, install the APK first.
Signature mismatch (most common) TinyFacade uses a signature-level permission. Both apps must be signed with the same keystore.
For development, copy TinyFacade's debug.keystore to your project and point your signing config at it:
signingConfigs {
getByName("debug") {
storeFile = file("path/to/tinyfacade/debug.keystore")
storePassword = "android"
keyAlias = "androiddebugkey"
keyPassword = "android"
}
}
Missing permission in manifest
<uses-permission android:name="com.tinyfacade.permission.USE_INFERENCE" />
Missing queries block (required for Android 11+)
<queries>
<package android:name="com.tinyfacade" />
</queries>
Wrong intent action or package Must be exactly:
val intent = Intent("com.tinyfacade.INFERENCE_SERVICE").apply {
setPackage("com.tinyfacade")
}
TinyFacade not running Open the TinyFacade app at least once. The service starts as a foreground service when the app launches.
Symptoms: getAvailableModels() returns empty list, onModelLoaded(false) fires, "no models" in logs.
Where to put GGUF files TinyFacade scans two locations:
/sdcard/Android/data/com.tinyfacade/files/ (app's external files)/sdcard/Download/ (Downloads folder)Push via adb:
adb push my-model.gguf /sdcard/Android/data/com.tinyfacade/files/
File must have .gguf extension
Only files ending in .gguf are discovered.
Storage permissions On some devices, you may need to grant TinyFacade storage permissions manually in Settings.
Model too large
If onModelLoaded(false) fires, the model may be too large for device RAM. Try a smaller quantization (Q4_K_M instead of Q8_0).
Load another model first
If a model is already loaded, call releaseModel() before loading a different one.
Symptoms: Very slow token generation, low tokens/second, UI lag during generation.
Use GPU layers
Set n_gpu_layers to 99 (or higher) to offload to GPU:
params.putInt("n_gpu_layers", 99)
Reduce context size
Lower n_ctx if you don't need large context:
params.putInt("n_ctx", 1024) // instead of 2048
Use smaller models Recommended for mobile:
Reduce max tokens
params.putInt("n_predict", 256) // instead of 512
Check device temperature Thermal throttling significantly reduces inference speed. Let the device cool down.
Only one model at a time Loading multiple models consumes all available memory. Release one before loading another.
Symptoms: Model doesn't call tools, tool results not incorporated, tools return errors.
Enable tools in params
Must set enable_tools to true:
params.putBoolean("enable_tools", true)
Model must support tool calling Not all GGUF models support tool calling. TinyFacade uses the model's chat template to format tool prompts. Models that work well:
Message format
Messages must be JSON with role and content fields:
[{"role": "user", "content": "What time is it?"}]
Tool calling is transparent Your app never sees the tool loop. If tools are enabled:
<tool_call> tags, executes the tool, feeds results backonToken() only receives the final natural-language responseIf you're not getting tool results, the model may not be generating tool calls — try a prompt that clearly needs a tool ("What's the current time?" for get_current_time).
Custom tool registration Verify registration succeeded:
val ok = service.registerTool(definition, action)
// ok should be true
Then verify it appears:
val tools = service.availableTools // JSON string
HTTP tool timeouts
If a custom HTTP tool times out, increase timeout_ms or check the URL.
Symptoms: bindService() returns false silently, SecurityException in logcat.
TinyFacade declares a signature-level permission:
<permission
android:name="com.tinyfacade.permission.USE_INFERENCE"
android:protectionLevel="signature" />
This means only apps signed with the exact same certificate can bind to the service.
Both apps must use the same debug.keystore. Options:
Copy TinyFacade's keystore to your project:
cp /path/to/TinyFacade/android/app/debug.keystore ./
Point your signing config at it:
signingConfigs {
getByName("debug") {
storeFile = file("debug.keystore")
storePassword = "android"
keyAlias = "androiddebugkey"
keyPassword = "android"
}
}
For release, you must:
# Check TinyFacade's signature
adb shell dumpsys package com.tinyfacade | grep -A5 "signatures"
# Check your app's signature
adb shell dumpsys package com.example.myapp | grep -A5 "signatures"
Both should show the same certificate fingerprint.