Hi, we’ve recently introduced Kotlin and AndroidTest somehow started to fail.
Looks like there are 2 issues
- AndroidTest can not reference Kotlin code
- Window can not be focused and fails (Probably this happens because the first test fails with 1. issue )
It succeeds locally so I’m not sure why this happens. Any idea?
_Does a “Rebuild” help?
NO
_Does a rebuild without caches help?
No. Tried clear cache but did not work.
_If you have multiple different build configurations (workflows), does the issue affect all/more than one?
Only using one workflow
If it’s an issue which happens sporadically, what’s the frequency? (e.g. Once a day ; about x% of the builds) :
100%
Does upgrading the build Step to the latest version help? :
NO
When did the issue start? :
A few days ago
com.xxx.xxx.home.HomeFragmentTest > handleBannerClick_openWebView[android-24(AVD) - 7.0] FAILED
java.lang.NullPointerException: Attempt to invoke virtual method 'kotlin.Unit com.xxx.xxx.home.HomeFragment.handleBannerClick(com.xxx.xxx.data.api.proto.HomeBannerContent)' on a null object reference
at com.xxx.xxx.home.HomeFragmentTest.handleBannerClick_openWebView(HomeFragmentTest.java:63)
com.xxx.xxx.home.HomeFragmentTest > handleBannerClick_openSearch[android-24(AVD) - 7.0] FAILED
java.lang.RuntimeException: Waited for the root of the view hierarchy to have window focus and not be requesting layout for over 10 seconds. If you specified a non default root matcher, it may be picking a root that never takes focus. Otherwise, something is seriously wrong. Selected Root:
Root{application-window-token=android.view.ViewRootImpl$W@f60d6da, window-token=android.view.ViewRootImpl$W@f60d6da, has-window-focus=false, layout-params-type=1, layout-params-string=WM.LayoutParams{(0,0)(fillxfill) sim=#120 ty=1 fl=#85810100 pfl=0x20000 wanim=0x1030465 needsMenuKey=2}, decor-view-string=DecorView{id=-1, visibility=VISIBLE, width=768, height=1280, has-focus=true, 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, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}}
Thank you in advance