Skip to content

Android API 37 emulator: Detox fails during app launch in beforeAll with Espresso NoSuchMethodException #4967

Description

@dbaonguisWakefern

Did you test using the latest Detox?

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

Did your test fail and you're not sure why?

  • I have read the troubleshooting guide and it didn't help me.

What happened?

Android build config used to build app and test APKs

buildscript {
    ext {
        buildToolsVersion = "35.0.0"
        minSdkVersion = 28
        compileSdkVersion = 35
        targetSdkVersion = 35
        ndkVersion = "27.1.12297006"
        playServicesVersion = "18.0.0"
        playServicesLocationVersion = "21.0.1"
        supportLibVersion = "28.0.3"
        androidMapsUtilsVersion = "2.2.5"
        kotlinVersion = "2.0.21"
    }
    ...
}

Generic test scenario

  • A simple Detox suite that launches the app in beforeAll using
    beforeAll(async () => {
     await device.launchApp({
       delete: true,
       newInstance: true,
       permissions: { notifications: 'YES' },
     });
    });
    
  • Failure occurs before actual test steps/assertions execute.

Reproduction

  1. Start Android emulator API 37.
  2. Run Detox with android.emu.release.
  3. Observe failure during launch/startup phase.

Actual behavior

  • Detox allocates emulator and installs app/test APKs.
  • Instrumentation starts, then crashes during Espresso initialization.
  • Suite times out in beforeAll.

Key error from sanitized logs

  • java.lang.RuntimeException: java.lang.NoSuchMethodException: android.hardware.input.InputManager.getInstance []
  • at androidx.test.espresso.base.InputManagerEventInjectionStrategy.initialize(...)
  • Caused by: java.lang.NoSuchMethodException: android.hardware.input.InputManager.getInstance []

Additional notes

  • This appears independent of test-specific logic because crash happens before test body execution.
  • Same setup passes on API 36 and fails on API 37.

Attachments

  • detox.log.sanitized
  • detox.trace.json.sanitized

What was the expected behaviour?

  • device.launchApp completes and tests proceed.

In what environment did this happen?

Detox version: 20.46.0
React Native version: 0.79.0
Has Fabric (React Native's new rendering system) enabled: (no)
Node version: v20.18.3
Device model: emulator with SDK API level 37
Android version: 17
Test-runner (select one): jest

Detox logs

Detox logs
see attached file

[detox.log.sanitized.zip](https://github.com/user-attachments/files/30324438/detox.log.sanitized.zip)

Device logs

Device logs
see attached file

[detox.trace.json.sanitized.zip](https://github.com/user-attachments/files/30324452/detox.trace.json.sanitized.zip)

More data, please!

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions