'java.lang.NoSuchMethodException: No such accessible method: matcherForSufficientlyVisible() on class: com.wix.detox.espresso.DetoxMatcher

I'm trying to call toBeVisible() from Detox which is documented here:

https://wix.github.io/Detox/docs/api/expect#tobevisible

But every time I try to run a code such as:

await expect(element(by.id('UniqueId203'))).toBeVisible();

It's throwing an exception:

java.lang.NoSuchMethodException: No such accessible method: matcherForSufficientlyVisible() on class: com.wix.detox.espresso.DetoxMatcher
        at org.apache.commons.lang3.reflect.MethodUtils.invokeStaticMethod(MethodUtils.java:439)
        at org.apache.commons.lang3.reflect.MethodUtils.invokeStaticMethod(MethodUtils.java:405)
        at com.wix.invoke.types.ClassTarget.execute(ClassTarget.java:23)
        at com.wix.invoke.types.Target.invoke(Target.java:59)
        at com.wix.invoke.types.Target.invoke(Target.java:55)
        at com.wix.invoke.MethodInvocation.invoke(MethodInvocation.java:35)
        at com.wix.invoke.MethodInvocation.invoke(MethodInvocation.java:26)
        at com.wix.invoke.MethodInvocation.invoke(MethodInvocation.java:20)
        at com.wix.detox.adapters.server.InvokeActionHandler.handle(DetoxActionHandlers.kt:56)
        at com.wix.detox.adapters.server.ActionsExecutor$executeAction$$inlined$let$lambda$1.run(DetoxActionsDispatcher.kt:64)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at com.wix.detox.adapters.server.ActionsExecutor$1.run(DetoxActionsDispatcher.kt:50)
        at java.lang.Thread.run(Thread.java:923)

All the rest of Detox functions such as detox.init() and finding and clicking on elements are behaving as expected. But for some reason toBeVisible() is throwing an exception. Any ideas?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source