我似乎无法得到命令行命令摇篮与API 23谷歌API仿真图像工作(谷歌API的ARM(armeabi-V7A)
) - 我总是一 com.android.ddmlib.ShellCommandUnresponsiveException
。
I can't seem to get Gradle commands from the command line to work with the API 23 Google API emulator image (Google APIs ARM (armeabi-v7a)
) - I always get a com.android.ddmlib.ShellCommandUnresponsiveException
.
重现步骤:
创建一个AVD与API 23谷歌API的ARM(armeabi-V7A)
克隆https://github.com/googlemaps/android-maps-utils (或使用您自己的项目)
运行 gradlew installDebug
在命令行
Create an AVD with API 23 Google APIs ARM (armeabi-v7a)
Clone https://github.com/googlemaps/android-maps-utils (or use your own project)
Run gradlew installDebug
from the command line
您将看到:
:演示:assembleDebug :演示:installDebug失败。
:demo:assembleDebug :demo:installDebug FAILED
失败:建立失败,一个异常
FAILURE: Build failed with an exception.
出了什么问题:执行失败的任务:演示:installDebug。 com.android.builder.testing.api.DeviceException:com.android.ddmlib.ShellCommandUnresponsiveException
Execution failed for task ':demo:installDebug'. com.android.builder.testing.api.DeviceException: com.android.ddmlib.ShellCommandUnresponsiveException
如果您运行 gradlew connectedCheck
,你会看到一个类似的错误:
If you run gradlew connectedCheck
you'll see a similar error:
我可以安装/没有任何问题,运行该项目,并测试从机器人工作室(1.4)。
I can install/run the project and tests from Android Studio (1.4) without any problems.
摇篮命令似乎运行得很好的 API 21 谷歌API仿真器命令行形象。
Gradle commands seem to run fine on the API 21 Google API emulator image from the command line.
下面是特拉维斯一个例子失败API 23谷歌API仿真图像:
Here is an example failure on Travis for API 23 Google API emulator image:
https://travis-ci.org/barbeau/android-maps-utils/builds/83233500
...当使用API 21谷歌API模拟器像的例子成功的构建:
...and an example successful build when using the API 21 Google API emulator image:
https://travis-ci.org/barbeau/android-maps-utils/builds/83234555
这两者之间的唯一区别就是建立的谷歌API的仿真器API级别23与21:
The only difference between the two builds is the Google API emulator API level of 23 vs. 21:
https://github.com/barbeau/android-maps-utils/commit/a5eecd7e7a4fc899ecd5eaeae6826414fefeae70
修改
我在这里就这个问题开了一个AOSP问题:
I've opened an AOSP issue here on this problem:
https://$c$c.google.com/p/android/issues/detail?id=190200
这是已在此报道同样的问题
阅读从unity3开发商解决方法有关硬盘codeD这里低超时
Read the workaround from the unity3 developer about the hardcoded and low timeout here
和星 问题
您是对的。这不是一个特拉维斯慈问题,重现它,你只需要创建一个armeabi-V7A仿真器,并尝试从摇篮命令在本地安装任何应用程序。
You are right. It's not a Travis-ci issue, to reproduce it, you only need to create an armeabi-v7a emulator and try to install any app locally from gradle command.
下面的详细信息,我的回答的UPDATE3
更新:
您可以避开 installVariant
任务,并利用亚行这个问题:
You can avoid the installVariant
tasks and this issue using 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
它的工作原理:
It works:
...
: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:..