Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/214.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android CircleCI上的浓缩咖啡测试失败_Android_Gradle_Android Gradle Plugin_Circleci - Fatal编程技术网

Android CircleCI上的浓缩咖啡测试失败

Android CircleCI上的浓缩咖啡测试失败,android,gradle,android-gradle-plugin,circleci,Android,Gradle,Android Gradle Plugin,Circleci,我正试图在CircleCI上运行Android项目检测测试。它们在本地机器上执行良好,既可以从AndroidStudio运行,也可以从命令行运行。CircleCI执行为每个测试生成此stacktrace: 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

我正试图在CircleCI上运行Android项目检测测试。它们在本地机器上执行良好,既可以从AndroidStudio运行,也可以从命令行运行。CircleCI执行为每个测试生成此stacktrace:

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@677cf28, window-token=android.view.ViewRootImpl$W@677cf28, has-window-focus=false, layout-params-type=1, layout-params-string=WM.LayoutParams{(0,0)(fillxfill) sim=#100 ty=1 fl=#81810100 wanim=0x1030466 surfaceInsets=Rect(0, 0 - 0, 0) needsMenuKey=2}, decor-view-string=DecorView{id=-1, visibility=VISIBLE, width=480, height=800, 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}}
. All Roots:
Root{application-window-token=android.view.ViewRootImpl$W@677cf28, window-token=android.view.ViewRootImpl$W@677cf28, has-window-focus=false, layout-params-type=1, layout-params-string=WM.LayoutParams{(0,0)(fillxfill) sim=#100 ty=1 fl=#81810100 wanim=0x1030466 surfaceInsets=Rect(0, 0 - 0, 0) needsMenuKey=2}, decor-view-string=DecorView{id=-1, visibility=VISIBLE, width=480, height=800, 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}}
at android.support.test.espresso.base.RootViewPicker.get(RootViewPicker.java:99)
at android.support.test.espresso.ViewInteractionModule.provideRootView(ViewInteractionModule.java:69)
at android.support.test.espresso.ViewInteractionModule_ProvideRootViewFactory.get(ViewInteractionModule_ProvideRootViewFactory.java:23)
at android.support.test.espresso.ViewInteractionModule_ProvideRootViewFactory.get(ViewInteractionModule_ProvideRootViewFactory.java:9)
at android.support.test.espresso.base.ViewFinderImpl.getView(ViewFinderImpl.java:68)
at android.support.test.espresso.ViewInteraction$1.run(ViewInteraction.java:120)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
有什么建议吗? 以下是circle.yml的相关部分:

machine:
  environment:
    ANDROID_HOME: /usr/local/android-sdk-linux
    ADB_INSTALL_TIMEOUT: 8

dependencies:
  override:
    - echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-21.1.2,android-22,extra-google-m2repository,extra-google-google_play_services,extra-android-support
    - ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies

test:
  override:
    - emulator -avd circleci-android22 -no-audio -no-window:
        background: true
        parallel: true
    - circle-android wait-for-boot
    # Build everything first
    - ./gradlew assembleDebugAndroidTest
    # Remove the look screen
    - adb shell input keyevent 82
    - sleep 5
    - ./gradlew connectedAndroidTest
    # copy the build outputs to artifacts
    - cp -r my-project/build/outputs $CIRCLE_ARTIFACTS
    # copy the test results to the test results directory.
    - cp -r my-project/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS
    - (./gradlew assemble):
        timeout: 360

我已经联系了CircleCI支持部门,并恳请他们创建一个带有浓缩咖啡测试的示例项目

所以


它帮助了我。希望它也能对您有所帮助。

听起来您的应用程序从未运行过。你能让你的expresso测试截图看看circleci运行时发生了什么吗?你找到解决方案了吗?我也有类似的问题。@Ivelius还没有解决方案,如果你发现了什么,请发帖!