【问题标题】:How I should configure Gradle Android Library for Travis CI我应该如何为 Travis CI 配置 Gradle Android 库
【发布时间】:2015-04-26 16:33:07
【问题描述】:

我正在开发一个安卓库。 我的项目正在使用 Gradle,并且没有任何应用程序模块。只是图书馆。 我已经将这个连接到 Travis CI,但我的每个推送控制台都显示我的构建过程失败了。 这是我的 travis.yml

language: android
android:
  components:
    - build-tools-22.0.1
    - android-22
    - extra-android-m2repository
  licenses:
    - android-sdk-license-.+
before_install:
 - chmod +x gradlew
before_script:
 - echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a
 - emulator -avd test -no-skin -no-audio -no-window &
 - curl http://is.gd/android_wait_for_emulator > android-wait-for-emulator
 - chmod u+x android-wait-for-emulator
 - ./android-wait-for-emulator
 - adb shell input keyevent 82 &

我得到了错误:

* What went wrong:
Execution failed for task ':library:connectedAndroidTest'.
com.android.builder.testing.ConnectedDevice > runTests[test(AVD) - 5.0] FAILED 
    com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to establish session
        at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:108)
null

那么我必须做些什么来解决这个问题?谢谢!

【问题讨论】:

标签: gradle continuous-integration travis-ci android-library


【解决方案1】:

像这样在 travis.yml 中添加至少一个图像文件

- sys-img-armeabi-v7a-android-19
- sys-img-x86-android-17

【讨论】:

    猜你喜欢
    • 2015-01-04
    • 1970-01-01
    • 1970-01-01
    • 2021-08-14
    • 2019-03-28
    • 2016-04-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多