【发布时间】:2017-01-31 03:47:31
【问题描述】:
如果我在本地模拟器上运行仪器测试,它们会完美运行 10 次中的 10 次,但是当我尝试在 Travis CI 中的 AVD 上运行相同的测试时,我随机得到 p>
FAILED java.lang.RuntimeException: Could not launch intent Intent { } within 45 seconds. Perhaps the main thread has not gone idle within a reasonable amount of time? There could be an animation or something constantly repainting the screen. Or the activity is doing network calls on creation? See the threaddump logs. For your reference the last time the event queue was idle before your activity launch request was xxxxxxx and now the last time the queue went idle was: xxxxxxxxx. If these numbers are the same your activity might be hogging the event queue.
我已尝试删除所有进度条和所有内容,但它仍然是一个仅随机发生在 Travis 上的问题。 我的 travis.yml 看起来像这样:
env:
global:
- ANDROID_TARGET=android-19
- ANDROID_ABI=armeabi-v7a
before_script:
- android list targets
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
- emulator -avd test -no-skin -no-audio -no-window -no-boot-anim &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- ./gradlew jacocoTestReport assembleAndroidTest connectedCheck zipalignRelease
【问题讨论】:
标签: android travis-ci instrumentation avd