Sea*_*eau 13 android android-emulator android-studio android-gradle-plugin
我似乎无法从命令行获取Gradle命令来使用API 23 Google API模拟器图像(Google APIs ARM (armeabi-v7a)) - 我总是得到一个com.android.ddmlib.ShellCommandUnresponsiveException.
重现步骤:
Google APIs ARM (armeabi-v7a)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问题:
简短的回答
Android Gradle Plugin的硬编码超时值太低.
谷歌在版本2.0.0-beta3中修复了它:
将在2.0.0-beta3.
那么我们在build.gradle中设置什么来设置这个超时值呢?
目前它全部附加到android.adbOptions.timeOutInMs.
示例:Google项目增加ADB超时并添加Travis-ci支持.它有效!
以前的回复
请阅读unity3开发人员关于硬编码和低超时的解决方法
和明星 的问题
你是对的.这不是Travis-ci问题,要重现它,您只需要创建一个armeabi-v7a模拟器并尝试从gradle命令本地安装任何应用程序.
更多信息,我的答案的更新3
更新:
您可以installVariant使用adb 来避免任务和此问题:
./gradlew clean
./gradlew assembleDebug
./gradlew assembleDebugAndroidTest
adb install app/build/outputs/apk/app-debug.apk
adb install app/build/outputs/apk/app-debug-androidTest-unaligned.apk
adb shell am instrument -w com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
Run Code Online (Sandbox Code Playgroud)
有用:
...
:app:assembleDebugAndroidTest
BUILD SUCCESSFUL
Total time: 19.787 secs
2413 KB/s (4204090 bytes in 1.701s)
pkg: /data/local/tmp/app-debug.apk
Success
1984 KB/s (1058902 bytes in 0.521s)
pkg: /data/local/tmp/app-debug-androidTest-unaligned.apk
Success
com.google.samples.apps.topeka.activity.SignInActivityTest:.
com.google.samples.apps.topeka.activity.quiz.EntertainmentQuizTest:.
com.google.samples.apps.topeka.activity.quiz.GeneralKnowledgeQuizTest:..
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4410 次 |
| 最近记录: |