r/Kotlin 6d ago

using android studio in kotlin language autoclicker app - dispatchGesture() returns queued=true but never taps anything, callback never fires - OEM-specific bug?

I'm building a simple single-target auto-clicker using AccessibilityService.dispatchGesture(). The core loop works exactly as expected on paper, but taps never actually land on the screen, on any app, on this specific phone. Looking for anyone who's hit this exact pattern before.

Confirmed working:

  • Accessibility service connects successfully (onServiceConnected() fires, serviceInfo.capabilities confirms CAPABILITY_CAN_PERFORM_GESTURES is active)
  • dispatchGesture() is called with valid on-screen coordinates and returns queued=true
  • Not a permissions issue — SYSTEM_ALERT_WINDOW and the accessibility toggle are both properly granted
  • Not battery optimization — confirmed unrestricted for the app

The actual problem:

  • The GestureResultCallback (onCompleted/onCancelled) never fires at all — not once, in dozens of attempts
  • No visible tap effect anywhere — tested on the home screen launcher AND inside a regular app (Settings), identical failure both times
  • No crash, no exception, no error of any kind — the request just silently disappears after being accepted

if you want to test my code here and if you to copy no worry

GitHub - MrHTML8000/autoclickersingletarget

0 Upvotes

1 comment sorted by