- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在尝试让 travis-ci 与我的 android 应用程序一起工作。如果我只执行 assembleDebug 它工作正常。但我也想运行测试并生成代码覆盖率。这是我现在的配置:
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 compile your project
- android-23
# Additional components
# - extra-google-google_play_services
# - extra-google-m2repository
- extra-android-m2repository
# - addon-google_apis-google-19
# Specify at least one system image,
# if you need to run emulator(s) during your tests
- sys-img-armeabi-v7a-android-23
env:
global:
# install timeout in minutes (2 minutes by default)
- ADB_INSTALL_TIMEOUT=8
before_install:
- chmod +x gradlew
- pip install --user codecov
# Emulator Management: Create, Start and Wait
before_script:
- echo no | android create avd --force --name test --target android-23 --abi armeabi-v7a
- emulator -avd test -no-skin -no-audio -no-window -no-boot-anim &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- ./gradlew build connectedCheck --stacktrace
# - ./gradlew assembleDebug
after_success:
- codecov
即使我已将 ADB_INSTALL_TIMEOUT
全局变量设置为 8 ( source ),构建仍会因 ShellCommandUnresponsiveException
而失败。构建本身甚至没有运行 8 分钟,所以它失败的原因很奇怪。
我尝试删除所有 Assets 文件以使应用程序尽可能小。但这没有帮助。
可以在此处找到失败的构建:https://travis-ci.org/Longi94/bptf/branches在我试图让它工作的 travis
分支下。有一个成功的构建。我不知道它是怎么过去的。
这是失败构建日志的一部分:
[0K$ echo no | android create avd --force --name test --target android-23 --abi armeabi-v7a
Android 6.0 is a basic Android platform.
Do you wish to create a custom hardware profile [no]Created AVD 'test' based on Android 6.0, ARM (armeabi-v7a) processor,
with the following hardware config:
hw.cpu.model=cortex-a8
hw.lcd.density=240
hw.ramSize=512
vm.heapSize=48
travis_time:end:1030008c:start=1446127538783461373,finish=1446127542625988764,duration=3842527391
[0Ktravis_fold:end:before_script.1
[0Ktravis_fold:start:before_script.2
[0Ktravis_time:start:16b2cef4
[0K$ emulator -avd test -no-skin -no-audio -no-window -no-boot-anim &
travis_time:end:16b2cef4:start=1446127542630405331,finish=1446127542635242867,duration=4837536
[0Ktravis_fold:end:before_script.2
[0Ktravis_fold:start:before_script.3
[0Ktravis_time:start:00e87790
[0K$ android-wait-for-emulator
emulator: WARNING: Increasing RAM size to 1GB
Waiting for emulator to start
Creating filesystem with parameters:
Size: 576716800
Block size: 4096
Blocks per group: 32768
Inodes per group: 7040
Inode size: 256
Journal blocks: 2200
Label:
Blocks: 140800
Block groups: 5
Reserved block group size: 39
Created filesystem with 11/35200 inodes and 4536/140800 blocks
resize2fs 1.42.13 (17-May-2015)
The filesystem is already 140800 (4k) blocks long. Nothing to do!
Creating filesystem with parameters:
Size: 69206016
Block size: 4096
Blocks per group: 32768
Inodes per group: 4224
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 16896
Block groups: 1
Reserved block group size: 7
Created filesystem with 11/4224 inodes and 1302/16896 blocks
emulator: UpdateCheck: current version '24.4.1', last version '24.4.1'
Waiting for emulator to start
... (pruned due to character limit)
Waiting for emulator to start
Emulator is ready
travis_time:end:00e87790:start=1446127542639319959,finish=1446127617455640922,duration=74816320963
[0Ktravis_fold:end:before_script.3
[0Ktravis_fold:start:before_script.4
[0Ktravis_time:start:0b2fd946
[0K$ adb shell input keyevent 82 &
travis_time:end:0b2fd946:start=1446127617473299362,finish=1446127617478276750,duration=4977388
[0Ktravis_fold:end:before_script.4
[0Ktravis_time:start:248749b0
[0K$ ./gradlew build connectedCheck --stacktrace
Downloading https://services.gradle.org/distributions/gradle-2.2.1-all.zip
................................................................................
Unzipping /home/travis/.gradle/wrapper/dists/gradle-2.2.1-all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1-all.zip to /home/travis/.gradle/wrapper/dists/gradle-2.2.1-all/6dibv5rcnnqlfbq9klf8imrndn
Set executable permissions for: /home/travis/.gradle/wrapper/dists/gradle-2.2.1-all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1/bin/gradle
Download https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.0/gradle-1.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.0/gradle-core-1.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/build/builder/1.3.0/builder-1.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/lint/lint/24.3.0/lint-24.3.0.pom
Download https://jcenter.bintray.com/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1.pom
Download https://jcenter.bintray.com/net/sf/proguard/proguard-parent/5.2.1/proguard-parent-5.2.1.pom
Download https://jcenter.bintray.com/com/android/tools/build/builder-model/1.3.0/builder-model-1.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/build/builder-test-api/1.3.0/builder-test-api-1.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/sdklib/24.3.0/sdklib-24.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/sdk-common/24.3.0/sdk-common-24.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/common/24.3.0/common-24.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/build/manifest-merger/24.3.0/manifest-merger-24.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/24.3.0/ddmlib-24.3.0.pom
Download https://jcenter.bintray.com/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom
Download https://jcenter.bintray.com/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
Download https://jcenter.bintray.com/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.pom
Download https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm/5.0.3/asm-5.0.3.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-parent/5.0.3/asm-parent-5.0.3.pom
Download https://jcenter.bintray.com/org/ow2/ow2/1.3/ow2-1.3.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.pom
Download https://jcenter.bintray.com/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0.pom
Download https://jcenter.bintray.com/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0.pom
Download https://jcenter.bintray.com/com/android/tools/lint/lint-checks/24.3.0/lint-checks-24.3.0.pom
Download https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.pom
Download https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.pom
Download https://jcenter.bintray.com/com/android/tools/annotations/24.3.0/annotations-24.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/layoutlib/layoutlib-api/24.3.0/layoutlib-api-24.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/dvlib/24.3.0/dvlib-24.3.0.pom
Download https://jcenter.bintray.com/com/google/code/gson/gson/2.2.4/gson-2.2.4.pom
Download https://jcenter.bintray.com/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.pom
Download https://jcenter.bintray.com/org/apache/commons/commons-parent/33/commons-parent-33.pom
Download https://jcenter.bintray.com/org/apache/apache/13/apache-13.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcomponents-client/4.1.1/httpcomponents-client-4.1.1.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/project/4.1.1/project-4.1.1.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcomponents-client/4.1/httpcomponents-client-4.1.pom
Download https://jcenter.bintray.com/com/google/guava/guava/17.0/guava-17.0.pom
Download https://jcenter.bintray.com/com/google/guava/guava-parent/17.0/guava-parent-17.0.pom
Download https://jcenter.bintray.com/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/lint/lint-api/24.3.0/lint-api-24.3.0.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.pom
Download https://jcenter.bintray.com/com/intellij/annotations/12.0/annotations-12.0.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcomponents-core/4.1/httpcomponents-core-4.1.pom
Download https://jcenter.bintray.com/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
Download https://jcenter.bintray.com/org/apache/commons/commons-parent/5/commons-parent-5.pom
Download https://jcenter.bintray.com/org/apache/apache/4/apache-4.pom
Download https://jcenter.bintray.com/commons-codec/commons-codec/1.4/commons-codec-1.4.pom
Download https://jcenter.bintray.com/org/apache/commons/commons-parent/11/commons-parent-11.pom
Download https://jcenter.bintray.com/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.pom
Download https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.0/gradle-1.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.0/gradle-core-1.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/build/builder/1.3.0/builder-1.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/lint/lint/24.3.0/lint-24.3.0.jar
Download https://jcenter.bintray.com/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1.jar
Download https://jcenter.bintray.com/com/android/tools/build/builder-model/1.3.0/builder-model-1.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/build/builder-test-api/1.3.0/builder-test-api-1.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/sdklib/24.3.0/sdklib-24.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/sdk-common/24.3.0/sdk-common-24.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/common/24.3.0/common-24.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/build/manifest-merger/24.3.0/manifest-merger-24.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/24.3.0/ddmlib-24.3.0.jar
Download https://jcenter.bintray.com/com/squareup/javawriter/2.5.0/javawriter-2.5.0.jar
Download https://jcenter.bintray.com/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.jar
Download https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar
Download https://jcenter.bintray.com/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0.jar
Download https://jcenter.bintray.com/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0.jar
Download https://jcenter.bintray.com/com/android/tools/lint/lint-checks/24.3.0/lint-checks-24.3.0.jar
Download https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.jar
Download https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.jar
Download https://jcenter.bintray.com/com/android/tools/annotations/24.3.0/annotations-24.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/layoutlib/layoutlib-api/24.3.0/layoutlib-api-24.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/dvlib/24.3.0/dvlib-24.3.0.jar
Download https://jcenter.bintray.com/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar
Download https://jcenter.bintray.com/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.jar
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.jar
Download https://jcenter.bintray.com/com/google/guava/guava/17.0/guava-17.0.jar
Download https://jcenter.bintray.com/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/lint/lint-api/24.3.0/lint-api-24.3.0.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar
Download https://jcenter.bintray.com/com/intellij/annotations/12.0/annotations-12.0.jar
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar
Download https://jcenter.bintray.com/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
Download https://jcenter.bintray.com/commons-codec/commons-codec/1.4/commons-codec-1.4.jar
Download https://jcenter.bintray.com/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.jar
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.agent/0.7.4.201502262128/org.jacoco.agent-0.7.4.201502262128.pom
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.build/0.7.4.201502262128/org.jacoco.build-0.7.4.201502262128.pom
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.agent/0.7.4.201502262128/org.jacoco.agent-0.7.4.201502262128.jar
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72310Library
:app:prepareComAndroidSupportCardviewV72310Library
:app:prepareComAndroidSupportDesign2310Library
:app:prepareComAndroidSupportRecyclerviewV72310Library
:app:prepareComAndroidSupportSupportV42310Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:unzipJacocoAgent
:app:instrumentDebug
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.ant/0.7.4.201502262128/org.jacoco.ant-0.7.4.201502262128.pom
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.core/0.7.4.201502262128/org.jacoco.core-0.7.4.201502262128.pom
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.report/0.7.4.201502262128/org.jacoco.report-0.7.4.201502262128.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-debug-all/5.0.1/asm-debug-all-5.0.1.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-parent/5.0.1/asm-parent-5.0.1.pom
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.ant/0.7.4.201502262128/org.jacoco.ant-0.7.4.201502262128.jar
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.core/0.7.4.201502262128/org.jacoco.core-0.7.4.201502262128.jar
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.report/0.7.4.201502262128/org.jacoco.report-0.7.4.201502262128.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm-debug-all/5.0.1/asm-debug-all-5.0.1.jar
:app:preDexDebug
:app:dexDebug
:app:validateDebugSigning
:app:packageDebug
:app:zipalignDebug
:app:assembleDebug
:app:checkReleaseManifest
:app:prepareReleaseDependencies
:app:compileReleaseAidl
:app:compileReleaseRenderscript
:app:generateReleaseBuildConfig
:app:generateReleaseAssets UP-TO-DATE
:app:mergeReleaseAssets
:app:generateReleaseResValues
:app:generateReleaseResources
:app:mergeReleaseResources
:app:processReleaseManifest
:app:processReleaseResources
:app:generateReleaseSources
:app:processReleaseJavaRes UP-TO-DATE
:app:compileReleaseJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:app:compileReleaseNdk UP-TO-DATE
:app:compileReleaseSources
:app:preDexRelease
:app:dexRelease
:app:packageRelease
:app:assembleRelease
:app:assemble
:app:compileLint
:app:lint
Ran lint on variant release: 102 issues found
Ran lint on variant debug: 102 issues found
Wrote HTML report to file:/home/travis/build/Longi94/bptf/app/build/outputs/lint-results.html
Wrote XML report to /home/travis/build/Longi94/bptf/app/build/outputs/lint-results.xml
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:processDebugUnitTestJavaRes UP-TO-DATE
:app:compileDebugUnitTestJavaWithJavac UP-TO-DATE
:app:compileDebugUnitTestSources UP-TO-DATE
:app:mockableAndroidJar
:app:assembleDebugUnitTest
:app:testDebugUnitTest
:app:preReleaseUnitTestBuild UP-TO-DATE
:app:prepareReleaseUnitTestDependencies
:app:processReleaseUnitTestJavaRes UP-TO-DATE
:app:compileReleaseUnitTestJavaWithJavac UP-TO-DATE
:app:compileReleaseUnitTestSources UP-TO-DATE
:app:assembleReleaseUnitTest
:app:testReleaseUnitTest
:app:test
:app:check
:app:build
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:processDebugAndroidTestJavaRes UP-TO-DATE
:app:compileDebugAndroidTestJavaWithJavac
:app:compileDebugAndroidTestNdk UP-TO-DATE
:app:compileDebugAndroidTestSources
:app:preDexDebugAndroidTest
:app:dexDebugAndroidTest
:app:packageDebugAndroidTest
:app:assembleDebugAndroidTest
:app:connectedDebugAndroidTest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:connectedDebugAndroidTest'.
> com.android.builder.testing.api.TestException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.ShellCommandUnresponsiveException
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:connectedDebugAndroidTest'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: org.gradle.internal.UncheckedException: com.android.builder.testing.api.TestException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.ShellCommandUnresponsiveException
at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:66)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 47 more
Caused by: com.android.builder.testing.api.TestException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.ShellCommandUnresponsiveException
at com.android.builder.testing.SimpleTestRunner.runTests(SimpleTestRunner.java:93)
at com.android.build.gradle.internal.tasks.DeviceProviderInstrumentTestTask.runTests(DeviceProviderInstrumentTestTask.java:112)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
... 54 more
Caused by: com.android.builder.testing.api.DeviceException: com.android.ddmlib.ShellCommandUnresponsiveException
at com.android.builder.testing.ConnectedDevice.getDeviceConfig(ConnectedDevice.java:259)
at com.android.builder.testing.api.DeviceConfigProviderImpl.<init>(DeviceConfigProviderImpl.java:36)
at com.android.builder.testing.SimpleTestRunner.runTests(SimpleTestRunner.java:91)
... 56 more
Caused by: com.android.ddmlib.ShellCommandUnresponsiveException
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:511)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:388)
at com.android.ddmlib.Device.executeShellCommand(Device.java:577)
at com.android.builder.testing.ConnectedDevice.executeShellCommand(ConnectedDevice.java:136)
at com.android.builder.testing.ConnectedDevice.getDeviceConfig(ConnectedDevice.java:256)
... 58 more
BUILD FAILED
Total time: 3 mins 27.125 secs
travis_time:end:248749b0:start=1446127617481908384,finish=1446127825369726746,duration=207887818362
[0K
[31;1mThe command "./gradlew build connectedCheck --stacktrace" exited with 1.[0m
Done. Your build exited with 1.
如有任何帮助,我们将不胜感激!
根据 ProbleSlover 的建议进行编辑:
删除 platform-tools
和 tools
行后。似乎构建没有等待足够长的时间让模拟器提前启动。现在有很多等待和构建超时并出现以下错误:
Waiting for emulator to start
Timeout (360 seconds) reached; failed to start emulator
The command "android-wait-for-emulator" failed and exited with 1 during .
Your build has been stopped.
最佳答案
简答
Android Gradle 插件的硬编码超时值太低。
Google 在 version 2.0.0-beta3 中修复了它:
Will be in 2.0.0-beta3.
So what do we put in build.gradle to set this timeout value?
Currently it's all attached to android.adbOptions.timeOutInMs.
示例:Google 项目 Increasing ADB timeout和 adding Travis-ci support .它works !
之前的回复
您正在禁用启动动画并且 android-wait-for-emulator
脚本依赖于它,因此默认脚本在模拟器准备就绪之前退出循环。阅读this great explanation .
我在脚本被窃听时写了它 here
现在脚本可以运行了,你只需要删除这里的-no-boot-anim
:
- emulator -avd test -no-skin -no-audio -no-window &
或者,您可以禁用加速它的启动动画,但您需要修改脚本,添加您知道足以让您的模拟器准备就绪的时间。
有时我会这样做,比如here
# Wait for device ready
function wait-for-device-ready {
local bootanim=""
local failcounter=0
until [[ "$bootanim" =~ "stopped" ]]; do
bootanim=`adb hell getprop init.svc.bootanim 2>&1`
echo "$bootanim"
if [[ "$bootanim" =~ "not found" ]]; then
let "failcounter += 1"
if [[ ${failcounter} -gt 30 ]]; then
echo "Failed to start emulator"
exit 1
fi
fi
sleep 1
done
sleep 30
adb shell input keyevent 82 &
sleep 150
echo "Done"
}
更新:现在我想起来了,我的回答大体上是正确的,但其他原因导致了这个问题,尤其是在 android-23 上,并且您可能在使用我的后仍然看到相同的错误建议,see .
我不确定关于 android-23 案例的其他问题,我需要调查它,但我目前没有使用 Travis-ci,只是一个 phew 测试。我认为 android-23 没有预装,你需要更新工具和平台工具,有时我看到一些应用程序在我的模拟器 api 23 在家里启动时崩溃,等等。如果没有看到它很难知道原因,但你可以添加日志试着看看发生了什么,检查my script为此。
更新2:
打开stackoverflow question和 android issue关于 android-23 上的这个错误。
更新3:
Cause: Hardcoded and too low timeout=5, line 256
try {
executeShellCommand("am get-config", receiver, 5, TimeUnit.SECONDS);
return DeviceConfig.Builder.parse(output);
} catch (Exception e) {
throw new DeviceException(e);
}
错误可在本地重现:
08:22:53.761 [ERROR] [org.gradle.BuildExceptionReporter]
08:22:53.795 " Caused by: com.android.ddmlib.ShellCommandUnresponsiveException
08:22:53.795 " at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:511)
08:22:53.795 " at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:388)
08:22:53.795 " at com.android.ddmlib.Device.executeShellCommand(Device.java:577)
08:22:53.796 " at com.android.builder.testing.ConnectedDevice.executeShellCommand(ConnectedDevice.java:136)
08:22:53.796 " at com.android.builder.testing.ConnectedDevice.getDeviceConfig(ConnectedDevice.java:256) <--------
08:22:53.796 " ... 78 more
Please star this issue, and read the unity3d workaround
更新4:
您可以使用 adb 作为解决方法,我测试过它适用于 Travis :
#!/bin/bash
############ ########### ########## ######### ######## ####### ###### ##### #### ### ## #
##
## ACIB SCRIPT
##
############ ########### ########## ######### ######## ####### ###### ##### #### ### ## #
# Run android tests
function android-test {
adb shell input keyevent 82 &
./gradlew assembleDebug -PdisablePreDex
./gradlew assembleDebugAndroidTest -PdisablePreDex
adb install app/build/outputs/apk/app-debug.apk
adb install app/build/outputs/apk/app-debug-androidTest-unaligned.apk
adb shell pm grant com.google.samples.apps.topeka android.permission.SET_ANIMATION_SCALE
adb shell am instrument -w -e numShards 6 -e shardIndex 0 -e package com.google.samples.apps.topeka com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
adb shell am instrument -w -e numShards 6 -e shardIndex 1 -e package com.google.samples.apps.topeka com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
adb shell am instrument -w -e numShards 6 -e shardIndex 2 -e package com.google.samples.apps.topeka com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
adb shell am instrument -w -e numShards 6 -e shardIndex 3 -e package com.google.samples.apps.topeka com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
adb shell am instrument -w -e numShards 6 -e shardIndex 4 -e package com.google.samples.apps.topeka com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
adb shell am instrument -w -e numShards 6 -e shardIndex 5 -e package com.google.samples.apps.topeka com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
}
我需要修复它,但安装成功,没有超时。
关于android - travis-ci 构建因 ShellCommandUnresponsiveException 不断失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33403743/
我最近在/ drawable中添加了一些.gifs,以便可以将它们与按钮一起使用。这个工作正常(没有错误)。现在,当我重建/运行我的应用程序时,出现以下错误: Error: Gradle: Execu
Android 中有返回内部存储数据路径的方法吗? 我有 2 部 Android 智能手机(Samsung s2 和 s7 edge),我在其中安装了一个应用程序。我想使用位于这条路径中的 sqlit
这个问题在这里已经有了答案: What's the difference between "?android:" and "@android:" in an android layout xml f
我只想知道 android 开发手机、android 普通手机和 android root 手机之间的实际区别。 我们不能从实体店或除 android marketplace 以外的其他地方购买开发手
自Gradle更新以来,我正在努力使这个项目达到标准。这是一个团队项目,它使用的是android-apt插件。我已经进行了必要的语法更改(编译->实现和apt->注释处理器),但是编译器仍在告诉我存在
我是android和kotlin的新手,所以请原谅要解决的一个非常简单的问题! 我已经使用导航体系结构组件创建了一个基本应用程序,使用了底部的导航栏和三个导航选项。每个导航选项都指向一个专用片段,该片
我目前正在使用 Facebook official SDK for Android . 我现在正在使用高级示例应用程序,但我不知道如何让它获取应用程序墙/流/状态而不是登录的用户。 这可能吗?在那种情
我在下载文件时遇到问题, 我可以在模拟器中下载文件,但无法在手机上使用。我已经定义了上网和写入 SD 卡的权限。 我在服务器上有一个 doc 文件,如果用户单击下载。它下载文件。这在模拟器中工作正常但
这个问题在这里已经有了答案: What is the difference between gravity and layout_gravity in Android? (22 个答案) 关闭 9
任何人都可以告诉我什么是 android 缓存和应用程序缓存,因为当我们谈论缓存清理应用程序时,它的作用是,缓存清理概念是清理应用程序缓存还是像内存管理一样主存储、RAM、缓存是不同的并且据我所知,缓
假设应用程序 Foo 和 Eggs 在同一台 Android 设备上。任一应用程序都可以获取设备上所有应用程序的列表。一个应用程序是否有可能知道另一个应用程序是否已经运行以及运行了多长时间? 最佳答案
我有点困惑,我只看到了从 android 到 pc 或者从 android 到 pc 的例子。我需要制作一个从两部手机 (android) 连接的 android 应用程序进行视频聊天。我在想,我知道
用于使用 Android 以编程方式锁定屏幕。我从 Stackoverflow 之前关于此的问题中得到了一些好主意,并且我做得很好,但是当我运行该代码时,没有异常和错误。而且,屏幕没有锁定。请在这段代
文档说: android:layout_alignParentStart If true, makes the start edge of this view match the start edge
我不知道这两个属性和高度之间的区别。 以一个TextView为例,如果我将它的layout_width设置为wrap_content,并将它的width设置为50 dip,会发生什么情况? 最佳答案
这两个属性有什么关系?如果我有 android:noHistory="true",那么有 android:finishOnTaskLaunch="true" 有什么意义吗? 最佳答案 假设您的应用中有
我是新手,正在尝试理解以下 XML 代码: 查看 developer.android.com 上的文档,它说“starStyle”是 R.attr 中的常量, public static final
在下面的代码中,为什么当我设置时单选按钮的外观会发生变化 android:layout_width="fill_parent" 和 android:width="fill_parent" 我说的是
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 9
假设我有一个函数 fun myFunction(name:String, email:String){},当我调用这个函数时 myFunction('Ali', 'ali@test.com ') 如何
我是一名优秀的程序员,十分优秀!