Detox Android - "Waited for the root of the view hierarchy..."

I use detox for e2e testing, ios works perfectly fine locally and also on Bitrise but I’m facing issue with Android on Bitrise while it’s ok locally.

Bitrise workflow:

e2e Testing: Install packages script:
npm install -g detox-cli

e2e Testing: Build release
detox build -c android.emu.debug

e2e Testing: Test release build
detox test -c android.emu.debug

Detox config
"android.emu.debug": { "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk", "build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..", "type": "android.emulator", "device": { "avdName": "emulator" } }, "android.emu.release": { "binaryPath": "android/app/build/outputs/apk/release/app-release.apk", "build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..", "type": "android.emulator", "device": { "avdName": "emulator" } }

Bitrise log:

java.lang.RuntimeException: Waited for the root of the view hierarchy to have window focus and not request layout for 10 seconds. If you specified a non default root matcher, it may be picking a root that never takes focus. Root:
Root{application-window-token=android.view.ViewRootImpl$W@fd80a13, window-token=android.view.ViewRootImpl$W@fd80a13, has-window-focus=false, layout-params-type=1, layout-params-string=WM.LayoutParams{(0,0)(fillxfill) sim=#120 ty=1 fl=#81810100 pfl=0x20000 wanim=0x10302f6 needsMenuKey=2 colorMode=0}, decor-view-string=DecorView{id=-1, visibility=VISIBLE, width=1080, height=1920, has-focus=false, has-focusable=true, has-window-focus=false, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=WM.LayoutParams{(0,0)(fillxfill) sim=#120 ty=1 fl=#81810100 pfl=0x20000 wanim=0x10302f6 needsMenuKey=2 colorMode=0}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=3}}
	at androidx.test.espresso.base.RootViewPicker.waitForRootToBeReady(RootViewPicker.java:111)
	at androidx.test.espresso.base.RootViewPicker.pickRootView(RootViewPicker.java:149)
	at androidx.test.espresso.base.RootViewPicker.get(RootViewPicker.java:91)
	at androidx.test.espresso.ViewInteractionModule.provideRootView(ViewInteractionModule.java:77)
	at androidx.test.espresso.ViewInteractionModule_ProvideRootViewFactory.provideRootView(ViewInteractionModule_ProvideRootViewFactory.java:37)
	at androidx.test.espresso.ViewInteractionModule_ProvideRootViewFactory.get(ViewInteractionModule_ProvideRootViewFactory.java:27)
	at androidx.test.espresso.ViewInteractionModule_ProvideRootViewFactory.get(ViewInteractionModule_ProvideRootViewFactory.java:10)
	at androidx.test.espresso.base.ViewFinderImpl.getView(ViewFinderImpl.java:63)
	at androidx.test.espresso.ViewInteraction.doPerform(ViewInteraction.java:223)
	at androidx.test.espresso.ViewInteraction.access$100(ViewInteraction.java:65)
	at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:158)
	at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:155)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at android.os.Handler.handleCallback(Handler.java:789)
	at android.os.Handler.dispatchMessage(Handler.java:98)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6541)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.