我似乎无法在命令行中使用Gradle命令与API 23 Google API模拟器镜像(Google APIs ARM (armeabi-v7a)
)配合使用- 我总是会遇到一个com.android.ddmlib.ShellCommandUnresponsiveException
的错误。
复现步骤:
- 创建一个API 23的AVD
Google APIs ARM (armeabi-v7a)
- 克隆 https://github.com/googlemaps/android-maps-utils (或使用您自己的项目)
- 从命令行运行
gradlew installDebug
你将看到:
:demo:assembleDebug :demo:installDebug FAILED
FAILURE: Build failed with an exception.
- 出错原因:
Execution failed for task ':demo:installDebug'. com.android.builder.testing.api.DeviceException: com.android.ddmlib.ShellCommandUnresponsiveException
如果你运行 gradlew connectedCheck
,你会看到类似的错误:
- 出错原因: Execution failed for task ':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模拟器镜像上似乎能正常运行。
以下是在API 23 Google API模拟器镜像上的Travis示例失败:
https://travis-ci.org/barbeau/android-maps-utils/builds/83233500
这里有一个使用API 21的Google API模拟器镜像构建成功的例子:
https://travis-ci.org/barbeau/android-maps-utils/builds/83234555
两个构建唯一的差别在于API级别,一个是23,另一个是21:
https://github.com/barbeau/android-maps-utils/commit/a5eecd7e7a4fc899ecd5eaeae6826414fefeae70
编辑
我在这里提出了一个关于这个问题的AOSP问题:
gradlew installDebug
会失败,并显示com.android.ddmlib.ShellCommandUnresponsiveException
。有趣的是,尝试从Android Studio安装会导致模拟器“电源循环”-我以前从未见过这种情况。 - Sean Barbeau