Wednesday, 8 July 2015

stupid travis-c



I use travis to build and run my unit test(junit) and automation test(espresso)

Issue: (of running espresso )

My project structure:




I want to use B.java in the test folder to replace B.java in the main folder.

Everything works fine in my local PC. (with commandline with android studio)

But in travis-ci:





junit.framework.TestSuite$1 > warning[test(AVD) - 4.4.4] FAILED
junit.framework.AssertionFailedError: Exception in constructor: testPickingListActivity_storeIdVerification (java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation


Then I think it is AVD version issue.

So I created a new simulator in my local PC, and I and reproduce this Error.  --- So it is AVD version issue.

My .travis.yml is:






Then I tried this:



Then I got this error:

0.42s$ echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
Valid ABIs: no ABIs.
Error: Invalid --abi armeabi-v7a for the selected target.
The command "echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI" failed and exited with 1 during .


Then:


However, I got error agin:



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@1be523c1, window-token=android.view.ViewRootImpl$W@1be523c1, has-window-focus=false, layout-params-type=1, layout-params-string=WM.LayoutParams{(0,0)(fillxfill) sim=#100 ty=1 fl=#1810100 wanim=0x1030466 surfaceInsets=Rect(0, 0 - 0, 0) needsMenuKey=2}, decor-view-string=DecorView{id=-1, visibility=VISIBLE, width=320, height=480, 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=1}}



As this post mentioned, it may be blocked by some window:

https://groups.google.com/forum/#!msg/android-test-kit-discuss/yIEwus_hjeY/xI1qpehDa7MJ

Because it is running on Travis, i can see nothing.


I did another try:




Finally:























No comments:

Post a comment