Detox icon indicating copy to clipboard operation
Detox copied to clipboard

Upgrading Detox from 20.10.0 to 20.12.0 (while on RN:v0.70.5) would cause java.lang.NoSuchMethodException: No such accessible method: matcherForTestId() on class: com.wix.detox.espresso.DetoxMatcher

Open mariushorvat opened this issue 1 year ago • 4 comments

What happened?

After I upgrade from v.20.10.0 to 20.12.0 I'm starting to get these errors in Android.

java.lang.NoSuchMethodException: No such accessible method: matcherForTestId() on class: com.wix.detox.espresso.DetoxMatcher at org.apache.commons.lang3.reflect.MethodUtils.invokeStaticMethod(MethodUtils.java:317) at org.apache.commons.lang3.reflect.MethodUtils.invokeStaticMethod(MethodUtils.java:279) 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:54) at com.wix.detox.adapters.server.ActionsExecutor.executeAction$lambda-2$lambda-1(DetoxActionsDispatcher.kt:64) at com.wix.detox.adapters.server.ActionsExecutor.$r8$lambda$nk3cF8ntnfFqbJOcVqd04vjb5nY(Unknown Source:0) at com.wix.detox.adapters.server.ActionsExecutor$$ExternalSyntheticLambda1.run(Unknown Source:8) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at com.wix.detox.adapters.server.ActionsExecutor.init$lambda-0(DetoxActionsDispatcher.kt:50) at com.wix.detox.adapters.server.ActionsExecutor.$r8$lambda$Hi5vyewqQiQqk57AkJy_cHqNGKY(Unknown Source:0) at com.wix.detox.adapters.server.ActionsExecutor$$ExternalSyntheticLambda0.run(Unknown Source:4) at java.lang.Thread.run(Thread.java:920)

What was the expected behaviour?

No response

Was it tested on latest Detox?

  • [X] I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

After I upgrade from v.20.10.0 to 20.12.0 I'm starting to get these errors in Android.

In what environment did this happen?

Detox version: 20.12.0 React Native version: 0.70.5 Has Fabric (React Native's new rendering system) enabled: (yes/no) no Node version: 18.17.1 Device model: Local Android Studio Emulator Android version: 12 - SDK 31 Test-runner (select one): jest / other jest

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
paste your device.log here!

More data, please!

No response

mariushorvat avatar Sep 14 '23 21:09 mariushorvat

More data that I've discovered since this issues was opened

  1. Detox v20.11.0 up to v20.11.4 work with React Native version: 0.70.5 but only with Android SDK 32 and up ( I assume)
  2. Detox v20.12.0 it does NOT work with Android SDK 32, I will update to SDK 33 and report back.

mariushorvat avatar Sep 14 '23 22:09 mariushorvat

I resolved this by cleaning via gradlew clean and making sure detox build -c android runs and succeeds on the new version.

There were various issues to fix to get the build to run, mostly from us being on an older Detox version and not updating in a while.

andreialecu avatar Nov 14 '23 11:11 andreialecu

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this repository, read this discussion.

stale[bot] avatar Dec 15 '23 04:12 stale[bot]

This same error happens to me when trying to run Detox via Browserstack, following these instructions: https://www.browserstack.com/docs/app-automate/detox/getting-started

If I run locally using "detox": "^20.18.4" everything works perfectly, however the docs say you need to use the patched version "detox": "npm:@avinashbharti97/detox@^20.1.2" in order to use Detox on Browserstack, which I think might be the issue as I'm currently using "react-native": "^0.73.0"

Error:

detox[17545] E ws-client expect element to be visible
  error: java.lang.NoSuchMethodException: No such accessible method: matcherForTestId() on class: com.wix.detox.espresso.DetoxMatcher

marklanham avatar Mar 01 '24 12:03 marklanham