Skip to content

[Android] Detox cannot connect to app #4834

@aaronpliu

Description

@aaronpliu

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?

When minify enabled, it's not working for Detox androidTest/ apk even if reference detox app rules.
When minify disabled, it's ok to work.

What was the expected behaviour?

  1. No need to build androidTest every time (unless required change)
  2. Detox apk is working for Android release build

Help us reproduce this issue!

minify enabled, build release(./gradlew app:assembleRelease) and androidTest (./gradlew assembleAndroidTest -DtestBuildType=release) separately

In what environment did this happen?

Detox version: 20.41.3
React Native version: 0.79.4
Has Fabric (React Native's new rendering system) enabled: (yes/no)
Node version: 18.20.4
Device model: Android emulator
Android version: 15
Test-runner (select one): jest / other

Detox logs

Detox logs
2025-09-22T09:44:18.442Z detox WARN:  i device An error occurred while waiting for the app to become ready. Waiting for disconnection...
  error: Failed to run application on the device
  
  HINT: Most likely, your main activity has crashed prematurely.
  
  Native stacktrace dump:
  java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;
        at androidx.test.platform.app.AppComponentFactoryRegistry.instantiateApplication(Unknown Source:2)
        at androidx.test.runner.MonitoringInstrumentation.newApplication(MonitoringInstrumentation.java:151)
        at androidx.test.runner.AndroidJUnitRunner.newApplication(AndroidJUnitRunner.java:300)
        at android.app.LoadedApk.makeApplicationInner(LoadedApk.java:1479)
        at android.app.LoadedApk.makeApplicationInner(LoadedApk.java:1411)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7790)
        at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2546)
        at android.os.Handler.dispatchMessage(Handler.java:110)
        at android.os.Looper.loopOnce(Looper.java:248)
        at android.os.Looper.loop(Looper.java:338)
        at android.app.ActivityThread.main(ActivityThread.java:9067)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932)
  Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
        ... 15 more
  
2025-09-22T09:44:18.442Z detox WARN:  i device The app disconnected.

Device logs

Device logs
paste your device.log here!

More data, please!

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions