相关疑难解决方法(0)

Travis CI Android测试:没有连接设备

我正在尝试为Android设置Travis.到目前为止,运行构建似乎工作,但是当涉及到测试时,它抱怨"没有连接的设备!"

:app:connectedAndroidTestDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:connectedAndroidTestDebug'.
> com.android.builder.testing.api.DeviceException: java.lang.RuntimeException: 
    No connected devices!
Run Code Online (Sandbox Code Playgroud)

这是我的.travis.yml,根据我的理解,我正在为测试创建和启动模拟器,就像文档所说的那样.

language: android
android:
  components:
    # Uncomment the lines below if you want to
    # use the latest revision of Android SDK Tools
    # - platform-tools
    # - tools

    # The BuildTools version used by your project
    - build-tools-22.0.1

    # The SDK version used to compile your project
    - android-22

    # Additional components
    - …
Run Code Online (Sandbox Code Playgroud)

continuous-integration android travis-ci

30
推荐指数
2
解决办法
6809
查看次数

API 23 Google API仿真器映像上的Gradle命令失败(armeabi-v7a)

我似乎无法从命令行获取Gradle命令来使用API​​ 23 Google API模拟器图像(Google APIs ARM (armeabi-v7a)) - 我总是得到一个com.android.ddmlib.ShellCommandUnresponsiveException.

重现步骤:

  1. 使用API​​ 23创建AVD Google APIs ARM (armeabi-v7a)
  2. 克隆https://github.com/googlemaps/android-maps-utils(或使用您自己的项目)
  3. 运行gradlew installDebug命令行

你会看到的:

:demo:assembleDebug:demo:installDebug FAILED

FAILURE:构建因异常而失败.

  • 什么地方出了错:

任务':demo:installDebug'的执行失败.com.android.builder.testing.api.DeviceException:com.android.ddmlib.ShellCommandUnresponsiveException

如果你跑,gradlew connectedCheck你会看到类似的错误:

  • 出了什么问题:任务执行失败':library:connectedDebugAndroidTest'.com.android.builder.testing.api.TestException:com.android.builder.testing.api.DeviceException:com.android.ddmlib.ShellCommandUnresponsiveException

可以安装/运行Android Studio(1.4)中的项目和测试,没有任何问题.

从命令行,Gradle命令似乎在API 21 Google API仿真器映像上正常运行.

以下是Travis for API 23 Google API模拟器映像的示例失败:

https://travis-ci.org/barbeau/android-maps-utils/builds/83233500

...以及使用API​​ 21 Google API仿真器映像时的成功构建示例:

https://travis-ci.org/barbeau/android-maps-utils/builds/83234555

这两个版本之间的唯一区别是Google API模拟器API级别为23对21:

https://github.com/barbeau/android-maps-utils/commit/a5eecd7e7a4fc899ecd5eaeae6826414fefeae70

编辑

我在这里就这个问题打开了一个AOSP问题:

https://code.google.com/p/android/issues/detail?id=190200

android android-emulator android-studio android-gradle-plugin

13
推荐指数
1
解决办法
4410
查看次数

travis-ci build keeps failing with ShellCommandUnresponsiveException

I'm trying to get travis-ci to work with my android application. If I only execute assembleDebug it works fine. But I want to run tests too and generate code coverage. This is the config I have right now:

language: android
android:
  components:
    # Uncomment the lines below if you want to
    # use the latest revision of Android SDK Tools
    - platform-tools
    - tools

    # The BuildTools version used by your project
    - build-tools-23.0.1

    # The SDK version used to …
Run Code Online (Sandbox Code Playgroud)

android travis-ci

6
推荐指数
1
解决办法
3459
查看次数

无法配置travis在android项目上工作

我发现了特拉维斯CI的几个问题,我一直在解决它们,但最后一个我不能解决它们.

我遇到了常见的错误 com.android.ddmlib.InstallException: Failed to establish session

这是我的travis文件:

language: android

before_install:
 - chmod +x gradlew

android:
  components:
    # Uncomment the lines below if you want to
    # use the latest revision of Android SDK Tools
    # - platform-tools
    # - tools

    # The BuildTools version used by your project
    - tools
    - build-tools-23.0.3

    # Additional components
    - extra-google-m2repository
    - extra-android-m2repository

    # The SDK version used to compile your project
    - android-23

    # Specify at least one system image,
    # if …
Run Code Online (Sandbox Code Playgroud)

android build travis-ci

5
推荐指数
1
解决办法
1240
查看次数