Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Espresso 3.7.0 doesn't support API 37: NoSuchMethodException: InputManager.getInstance

Closed
#2,507 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
android, java

Research direction

Start with InputManagerEventInjectionStrategy.initialize, which the stack trace identifies as reflecting on android.hardware.input.InputManager.getInstance(). Reproduce the failure with Robolectric 4.17 and API 37, then verify that Espresso initialization no longer throws NoSuchMethodException on API 37.

Written by the indexing model from the issue text.

Description

We observed this in unit tests with Robolectric 4.17 (which added SDK 37 support), but based on the stack it would be failing in Emulator 37 too.

        Caused by:
        java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoSuchMethodException: android.hardware.input.InputManager.getInstance()
            at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:124)
            at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:193)
            at androidx.test.espresso.Espresso.onIdle(Espresso.java:12)
            ... 45 more

            Caused by:
            java.lang.RuntimeException: java.lang.NoSuchMethodException: android.hardware.input.InputManager.getInstance()
                at androidx.test.espresso.base.InputManagerEventInjectionStrategy.initialize(InputManagerEventInjectionStrategy.java:28)
                at androidx.test.espresso.base.BaseLayerModule.provideEventInjector(BaseLayerModule.java:4)
                at androidx.test.espresso.base.BaseLayerModule_ProvideEventInjectorFactory.provideEventInjector(BaseLayerModule_ProvideEventInjectorFactory.java:1)
                at androidx.test.espresso.base.BaseLayerModule_ProvideEventInjectorFactory.get(BaseLayerModule_ProvideEventInjectorFactory.java:1)
                at androidx.test.espresso.base.BaseLayerModule_ProvideEventInjectorFactory.get(BaseLayerModule_ProvideEventInjectorFactory.java:2)
                at androidx.test.espresso.core.internal.deps.dagger.internal.DoubleCheck.get(DoubleCheck.java:6)
                at androidx.test.espresso.base.UiControllerImpl_Factory.get(UiControllerImpl_Factory.java:1)
                at androidx.test.espresso.base.UiControllerImpl_Factory.get(UiControllerImpl_Factory.java:2)
                at androidx.test.espresso.core.internal.deps.dagger.internal.DoubleCheck.get(DoubleCheck.java:6)
                at androidx.test.espresso.base.UiControllerModule_ProvideUiControllerFactory.get(UiControllerModule_ProvideUiControllerFactory.java:1)
                at androidx.test.espresso.base.UiControllerModule_ProvideUiControllerFactory.get(UiControllerModule_ProvideUiControllerFactory.java:2)
                at androidx.test.espresso.core.internal.deps.dagger.internal.DoubleCheck.get(DoubleCheck.java:6)
                at androidx.test.espresso.DaggerBaseLayerComponent$BaseLayerComponentImpl.uiController(DaggerBaseLayerComponent.java:1)
                at androidx.test.espresso.Espresso$1.run(Espresso.java:1)
                at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
                at android.os.Handler.$$robo$$android_os_Handler$handleCallback(Handler.java:1095)
                at android.os.Handler.handleCallback(Handler.java)
                at android.os.Handler.$$robo$$android_os_Handler$dispatchMessageImpl(Handler.java:135)
                at android.os.Handler.dispatchMessageImpl(Handler.java)
                at android.os.Handler.$$robo$$android_os_Handler$dispatchMessage(Handler.java:125)
                at android.os.Handler.dispatchMessage(Handler.java)
                at org.robolectric.shadows.ShadowPausedLooper$IdlingRunnable.run(ShadowPausedLooper.java:542)
                at org.robolectric.shadows.LooperControlService.executeControlTask(LooperControlService.java:174)
                at org.robolectric.shadows.LooperControlService.executeControlTask(LooperControlService.java:166)
                at org.robolectric.shadows.ShadowPausedLooper.idle(ShadowPausedLooper.java:104)
                at org.robolectric.android.internal.LocalControlledLooper.drainMainThreadUntilIdle(LocalControlledLooper.java:19)
                at androidx.test.espresso.Espresso.onIdle(Espresso.java:11)
                ... 45 more

                Caused by:
                java.lang.NoSuchMethodException: android.hardware.input.InputManager.getInstance()
                    at java.base/java.lang.Class.getDeclaredMethod(Class.java:2422)
                    at androidx.test.espresso.base.InputManagerEventInjectionStrategy.initialize(InputManagerEventInjectionStrategy.java:5)
                    ... 72 more
Dominant language
Java
Stars
1.2k
Forks
342
Avg merge
2d 22h
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from android/android-test

All issues in android/android-test

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.