I can't get Click to work on a specific element

I am using WDIO, Appium tech stack and executing my scripts on android emulator.
I am clicking on a button but its not happening but when I click manually in debug mode it works fine.
await accountPage.signout.click();
I am not getting any error while clicking its just not actioning.
logs

[0-0] 2024-10-03T01:02:25.461Z INFO webdriver: COMMAND findElement("xpath", "//android.widget.TextView[@text="Sign Out"]")
[0-0] 2024-10-03T01:02:25.462Z INFO webdriver: [POST] http://127.0.0.1:4723/session/4bbe6dc8-0e7e-409b-b085-ad608e98dcdc/element
[0-0] 2024-10-03T01:02:25.462Z INFO webdriver: DATA {
[0-0]   using: 'xpath',
[0-0]   value: '//android.widget.TextView[@text="Sign Out"]'
[0-0] }
[0-0] 2024-10-03T01:02:25.630Z INFO webdriver: RESULT {
[0-0]   'element-6066-11e4-a52e-4f735466cecf': '00000000-0000-0f16-ffff-ffff0000023c',
[0-0]   ELEMENT: '00000000-0000-0f16-ffff-ffff0000023c'
[0-0] }
[0-0] 2024-10-03T01:02:25.631Z INFO webdriver: COMMAND elementClick("00000000-0000-0f16-ffff-ffff0000023c")
[0-0] 2024-10-03T01:02:25.632Z INFO webdriver: [POST] http://127.0.0.1:4723/session/4bbe6dc8-0e7e-409b-b085-ad608e98dcdc/element/00000000-0000-0f16-ffff-ffff0000023c/click
[0-0] 2024-10-03T01:02:25.679Z INFO webdriver: RESULT null

It worked when used wait before clicking.
When I was using wait for displayed syntax

await element.waitForDisplayed({ timeout: 5000 }); 

but when I used

driver.pause(5000)

it worked perfectly fine… why is it so. ?

We do not know what happens before but with android test is fast enough to try tap while e.g. menu only start to appear. Obviously such tap fails.

  1. Enable in development mode on phone to show touches so you can see where it actually happens.
  2. Disable animation on phone in developer menu or using appropriate capability appium:disableWindowAnimation.

It could be that this returns true:

await element.waitForDisplayed({ timeout: 5000 }); 

Because your element is indeed displayed.
But is it “interactable” when it is displayed?
Maybe it’s moving and you always tap behind it, maybe there’s some other element on top of it, maybe it has a fade in animation, maybe there’s a different reason altogether.
Developer mode + show touches is the way to debug this like Aleksei said