Android Emulator on Jenkins error: device offline - android

I have installed the Android Emulator plugin for Jenkins. I can build and test an Android-project. My Jenkins is running on an Ubuntu-server (only access with terminal). The project is pulled from Github. Now I want to use the Emulator. This is my configuration:
Android OS version: 4.4
Screen density: 160
Screen resolution: 480x800
Target ABI:armeabi-v7a
I also installed adb and did the following command:
/opt/android-sdk-linux/tools/android update sdk --no-ui
But it doesn't work:
> /usr/bin/git rev-list 3440b28279e2e95113ce1c9499d9d881e76f6810 # timeout=10
$ /opt/android-sdk-linux/tools/android list target
[android] Using Android SDK: /opt/android-sdk-linux
$ /opt/android-sdk-linux/platform-tools/adb start-server
* daemon not running. starting it now on port 7767 *
* daemon started successfully *
$ /opt/android-sdk-linux/platform-tools/adb start-server
[android] Starting Android emulator
$ /opt/android-sdk-linux/tools/emulator -ports 7765,7766 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WVGA_android-19_armeabi-v7a -no-snapshot-load -no-snapshot-save -no-window
Failed to Initialize backend EGL display
Could not initialize emulated framebufferemulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
emulator: warning: opening audio output failed
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:7766
connected to localhost:7766
[android] Waiting for emulator to finish booting...
$ /opt/android-sdk-linux/platform-tools/adb -s localhost:7766 shell getprop init.svc.bootanim
error: device offline
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:7766
$ /opt/android-sdk-linux/platform-tools/adb -s localhost:7766 shell getprop init.svc.bootanim
error: device offline
...
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:7766
[android] Interrupted while waiting for emulator to finish booting.
[android] Emulator was shut down before it finished booting
$ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7766
[android] Stopping Android emulator
$ /opt/android-sdk-linux/platform-tools/adb kill-server
Archiving artifacts
Recording test results
ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception
hudson.AbortException: Test reports were found but none of them are new. Did tests run?
For example, AndroidManifest.xml is 10 min old
Is there someone with an explanation for this issue? Thanks

I face the same issue, even when trying the commands manually.
But I could solve the issue when using ports like 5555,5556 according to that comment: JENKINS-27456
There is an associated pull request: PR on github
I will see if I have time to get and test a build with that patch and will let you know if it solves that problem.

Related

Adb shell command ocassionally hangs from command line

We have a Xamarin test application, that we run automatically from command line on macOS Sierra. Before it we automatically launch Android emulator from command line. As Android emulator we use x86 emulator, accelerated with Intel HAXM. The script for emulator launching looks in the following way:
function isEmulatorReady {
pathToSDK=$1
#Check that emulator is booted by checking that boot animation is stopped
$pathToSDK/platform-tools/adb wait-for-device shell getprop init.svc.bootanim | grep -m 1 stopped
}
androidSDK=~/Library/Developer/Xamarin/android-sdk-macosx
$androidSDK/platform-tools/adb kill-server
$androidSDK/platform-tools/adb start-server
$androidSDK/tools/emulator -avd Android_Accelerated_x86 -wipe-data -partition-size 512 &
emulatorPID=$!
until isEmulatorReady $androidSDK; do
sleep 1
done
#launch application and wait for end
kill $emulatorPID
Ocassionally adb wait-for-device shell getprop command hangs and script can't detect that emulator is booted, while Android emulator is successfully booted and works. I don't know how to deal with it. The restart of adb server at the beginning doesn't help actually.

emulator: WARNING: Classic qemu does not support SMP. The hw.cpu.ncore option from your config file is ignored. in jenkins in Ubuntu [duplicate]

Jenkins can't start the emulator. Here is the console output of jenkins:
First time build. Skipping changelog.
Starting xvnc
[MatchMaking] $ vncserver :65 -localhost -nolisten tcp
New 'veam:65 (jenkins)' desktop is veam:65
Starting applications specified in /var/lib/jenkins/.vnc/xstartup
Log file is /var/lib/jenkins/.vnc/veam:65.log
$ /usr/local/android-sdk/tools/android list target
[android] Using Android SDK: /usr/local/android-sdk
[android] Adding 256M SD card to AVD 'hudson_en-US_160_WXGA720_android-15_x86'...
$ /usr/local/android-sdk/platform-tools/adb start-server
$ /usr/local/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_WXGA720_android-15_x86
[android] Starting Android emulator and creating initial snapshot
[android] Erasing existing emulator data...
$ /usr/local/android-sdk/tools/emulator -no-boot-anim -ports 60491,34583 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WXGA720_android-15_x86 -no-snapshot-load -no-snapshot-save -wipe-data
SDL init failure, reason is: No available video device
* daemon not running. starting it now on port 39546 *
* daemon started successfully *
[android] Emulator did not appear to start; giving up
$ /usr/local/android-sdk/platform-tools/adb disconnect localhost:34583
[android] Stopping Android emulator
$ /usr/local/android-sdk/platform-tools/adb kill-server
Terminating xvnc.
$ vncserver -kill :65
Killing Xvnc4 process ID 16861
Finished: NOT_BUILT
If I type in
/usr/local/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_WXGA720_android-15_x86
or
/usr/local/android-sdk/tools/emulator -no-boot-anim -ports 60491,34583 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WXGA720_android-15_x86 -no-snapshot-load -no-snapshot-save -wipe-data
I get
PANIC: Could not open: hudson_en-US_160_WXGA720_android-15_x86
I run jenkins on ubuntu 12.04.
The error "SDL init failure, reason is: No available video device" would suggest that the emulator isn't running in a graphical environment.
However, your log shows that a VNC server is being started. But perhaps the VNC server hasn't quite finished starting by the time the emulator starts.
You can check whether this is the case by delaying the emulator start by a few seconds.
From the Android Emulator plugin documentation:
Although the Android Emulator plugin has been designed to ensure it always runs after an Xvnc server has been started, the Xvnc plugin does not wait for the Xvnc server to be fully up-and-running before handing control over to the Android Emulator plugin.
For this reason, you may want to delay emulator startup by a few seconds (e.g. three to five), giving the Xvnc server time to finish starting-up before attempting to launch an Android emulator into it. To do so, enter the desired number of seconds in the "Startup delay" field under "Advanced" options.
Alternatively, you can untick the "Show emulator window" option in your job configuration, which won't show the emulator, and will remove the need to run a VNC server.

Android Emulator Jenkins Plugin not working

I am trying to use the Jenkins Android Emulator with Cloudbees and I am often experiencing this kind of output:
error: device offline
$ /opt/android/android-sdk-linux/platform-tools/adb connect localhost:44194
$ /opt/android/android-sdk-linux/platform-tools/adb -s localhost:44194 shell getprop dev.bootcomplete
error: device offline
$ /opt/android/android-sdk-linux/platform-tools/adb connect localhost:44194
$ /opt/android/android-sdk-linux/platform-tools/adb -s localhost:44194 shell getprop dev.bootcomplete
error: device offline
$ /opt/android/android-sdk-linux/platform-tools/adb disconnect localhost:44194
$ /opt/android/android-sdk-linux/platform-tools/adb connect localhost:44194
$ /opt/android/android-sdk-linux/platform-tools/adb -s localhost:44194 shell getprop dev.bootcomplete
error: device offline
$ /opt/android/android-sdk-linux/platform-tools/adb connect localhost:44194
$ /opt/android/android-sdk-linux/platform-tools/adb -s localhost:44194 shell getprop dev.bootcomplete
error: device offline
$ /opt/android/android-sdk-linux/platform-tools/adb connect localhost:44194
$ /opt/android/android-sdk-linux/platform-tools/adb -s localhost:44194 shell getprop dev.bootcomplete
error: device offline
$ /opt/android/android-sdk-linux/platform-tools/adb disconnect localhost:44194
$ /opt/android/android-sdk-linux/platform-tools/adb connect localhost:44194
$ /opt/android/android-sdk-linux/platform-tools/adb -s localhost:44194 shell getprop dev.bootcomplete
error: device offline
$ /opt/android/android-sdk-linux/platform-tools/adb connect localhost:44194
$ /opt/android/android-sdk-linux/platform-tools/adb -s localhost:44194 shell getprop dev.bootcomplete
error: device offline
$ /opt/android/android-sdk-linux/platform-tools/adb connect localhost:44194
[android] Timed-out after waiting 720 seconds for emulator
$ /opt/android/android-sdk-linux/platform-tools/adb disconnect localhost:44194
[android] Stopping Android emulator
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
$ /opt/android/android-sdk-linux/platform-tools/adb kill-server
Finished: NOT_BUILT
I am using andoird-19 as target but I have tried several.
I have also tried to reproduce the case on my local jenkins instance and it happens the same.
This gets worse when I try to load from snapshot: if I don't start from snapshot the emulator starts in the 50% of the cases, if I use the snapshots then it would always fail.
I am using emulator-arm as executable, since I read about some bugs with the 64bit version. Not sure it applies to r19 as well though.
Any idea?
The Jenkins Android Emulator issues I have had are legion. Here is a checklist to help:
1) You need the --all flag for both android list and android update sdk, otherwise some packages will not be installed: ex for SDK 24
1a)$ANDROID_HOME/tools/android list sdk --all
1b)
(for i in {1..100}; do echo y; sleep 1; done) |
$ANDROID_HOME/tools/android update sdk --no-ui --all --filter
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81,82,82,84,85,101,102,103,112,113,117,118,119,120,121,122,123,124
If you get the dreaded /home/jenkins/android-sdk-linux/platform-tools/adb -s emulator-XXXX shell getprop dev.bootcomplete error: device offline error, you are likely missing a package in step 1b
2)Ignore the dreaded Failed to Initialize backend EGL display error, it is a red herring
3)Be sure to use the Advanced Emulator options:
Emulator Options: -no-audio -gpu off
Emulator executable: emulator64-arm
Startup delay: 10 -- this *may* help
4)a pre-build script ${ANDROID_HOME}/platform-tools/adb kill-server can't hurt
Good luck!
I started having the same problem after upgrading the Android Emulator plugin to 2.11.1. Downgrading to 2.10 via the plugin manager has proved itself to be an acceptable workaround for me.
Experiencing the same issue, using the Jenkins Android Emulator Plugin v2.13 with emulators running android-19 and above.
I found an open Jenkins ticket to fix the issue here.
Looks like a fix would require an update to the Android Emulator Plugin. In the meantime one workaround is to use a pre-android-19 emulator - I have not had the issue on android-16, android-17 or android-18 emulators.
An alternative workaround is to try downgrading the Android Emulator Plugin to v2.10, as #zachgeek suggested.

Android Emulator Plugin Failed to Initialize backend EGL display

I set up a Jenkins Job on Cloudbees and I can successfully checkout and compile my Android project there. Now I would like to run some JUnit tests in the android emulator and added the Android emulator plugin. I set the “Show Emulator Window“ option to false but after startup of the emulator I always get the error message: “Emulator did not appear to start; giving up”.
Has anyone experience with Android builds on Cloudbees?
Build log:
$ /opt/android/android-sdk-linux/tools/android list target
[android] Using Android SDK: /opt/android/android-sdk-linux
[android] Creating Android AVD: /home/jenkins/.android/avd/hudson_en-US_160_WVGA_android-17_armeabi-v7a.avd
[android] /opt/android/android-sdk-linux/tools/android create avd -f -a -c 64M -s WVGA800 -n hudson_en-US_160_WVGA_android-17_armeabi-v7a -t android-17 --abi armeabi-v7a
$ /opt/android/android-sdk-linux/platform-tools/adb start-server
[android] Starting Android emulator
$ /opt/android/android-sdk-linux/tools/emulator -no-boot-anim -ports 59102,56142 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WVGA_android-17_armeabi-v7a -no-snapshot-load -no-snapshot-save -no-window
Failed to Initialize backend EGL display
* daemon not running. starting it now on port 52538 *
* daemon started successfully *
[android] Emulator did not appear to start; giving up
$ /opt/android/android-sdk-linux/platform-tools/adb disconnect localhost:56142
[android] Stopping Android emulator
$ /opt/android/android-sdk-linux/platform-tools/adb kill-server
Compare your job configuration with https://partnerdemo.ci.cloudbees.com/job/Android-dev/job/stockfish-android-cloud/, paying particular attention to the following settings:
Inject env var: LD_LIBRARY_PATH=/opt/android/android-sdk-linux/tool/lib
Target ABI: armeabi-v7a
Advanced -> Emulator Options: -no-audio -gpu off
Advanced -> Emulator Executable: emulator64-arm

Why is Jenkins Android Emulator Plugin recreating my Emulator Snapshots in every build?

I use Jenkins to build one of my projects. The Android Emulator Plugin automatically starts an emulator with the following configuration:
Configuration of the Emulator Plugin:
.
Every time the job is running I get the following output:
Erasing existing emulator data... $
/ci/home/tools/android-sdk//tools/emulator -no-boot-anim -ports
64470,64471 -prop persist.sys.language=de -prop persist.sys.country=DE
-avd hudson_de-DE_240_480x720_Google_Inc._Google_APIs_8 -no-snapshot-load -no-snapshot-save -wipe-data
.
.
shell input keyevent 4 [android] Giving the system some time to settle
before creating initial snapshot... $
.
.
localhost:64471 shell log -p v -t Jenkins "Creating snapshot..."
[android] Creating snapshot... $
Full log below.
It seems that the plugin is creating a new emulator every time and is not using snapshots.
This takes something between 2 and 4 minutes depending on the emulator configuration.
The plugin creates .avd and .ini files in the .android/avd directory inside the job folder. The avds are not deleted after the run process.
If I disable the use snapshots config the emulator needs less then a minute to start.
Is this an issue with the emulator plugin or are snapshots not possible because of my configuration?
I hope that using snapshots will speed up my building process a lot.
Full log:
$ /ci/home/tools/android-sdk//tools/android list target [android]
Using Android SDK: /ci/home/tools/android-sdk/ [android] Adding 200M
SD card to AVD 'hudson_de-DE_240_480x720_Google_Inc._Google_APIs_8'...
[android] Setting hardware properties: hw.ramSize: 512
$ /ci/home/tools/android-sdk//platform-tools/adb start-server
$ /ci/home/tools/android-sdk//tools/emulator -snapshot-list -no-window -avd hudson_de-DE_240_480x720_Google_Inc._Google_APIs_8
[android] Starting Android emulator and creating initial snapshot
[android] Erasing existing emulator data...
$ /ci/home/tools/android-sdk//tools/emulator -no-boot-anim -ports 64470,64471 -prop persist.sys.language=de -prop persist.sys.country=DE -avd hudson_de-DE_240_480x720_Google_Inc._Google_APIs_8 -no-snapshot-load -no-snapshot-save -wipe-data
* daemon not running. starting it now on port 64472 *
* daemon started successfully *
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
[android] Waiting for emulator to finish booting...
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471
shell getprop dev.bootcomplete error: device offline
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell getprop dev.bootcomplete
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell getprop dev.bootcomplete
$ /ci/home/tools/android-sdk//platform-tools/adb disconnect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell getprop dev.bootcomplete
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell getprop dev.bootcomplete
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell getprop dev.bootcomplete
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 logcat -v time
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
[android] Attempting to unlock emulator screen
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell input keyevent 82
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell input keyevent 4
[android] Giving the system some time to settle before creating initial snapshot...
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 logcat -c
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell log -p v -t Jenkins "Creating snapshot..."
[android] Creating snapshot...
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
[android] Emulator is ready for use (took 158 seconds)
Buildfile for an example job:
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.plugins.git.GitSCM">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<name></name>
<refspec></refspec>
<url>git#project...</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<disableSubmodules>false</disableSubmodules>
<recursiveSubmodules>false</recursiveSubmodules>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<authorOrCommitter>false</authorOrCommitter>
<clean>false</clean>
<wipeOutWorkspace>false</wipeOutWorkspace>
<pruneBranches>false</pruneBranches>
<remotePoll>false</remotePoll>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<useShallowClone>false</useShallowClone>
<buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
<gitTool>default</gitTool>
<submoduleCfg class="list"/>
<relativeTargetDir></relativeTargetDir>
<reference></reference>
<excludedRegions></excludedRegions>
<excludedUsers></excludedUsers>
<gitConfigName></gitConfigName>
<gitConfigEmail></gitConfigEmail>
<skipTag>false</skipTag>
<includedRegions></includedRegions>
<scmName></scmName>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>true</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>true</blockBuildWhenUpstreamBuilding>
<triggers class="vector">
<hudson.triggers.SCMTrigger>
<spec>*/5 * * * *</spec>
</hudson.triggers.SCMTrigger>
</triggers>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.tasks.Ant>
<targets>clean debug install</targets>
<antName>(Default)</antName>
</hudson.tasks.Ant>
<hudson.tasks.Ant>
<targets></targets>
<antName>(Default)</antName>
<buildFile>checkstyle-ant.xml</buildFile>
</hudson.tasks.Ant>
<hudson.tasks.Shell>
<command>os_opts="-Djava.awt.headless=true" lint --xml lint-results.xml .</command>
</hudson.tasks.Shell>
<hudson.plugins.android__emulator.monkey.MonkeyBuilder>
<packageId>de....</packageId>
<eventCount>1000</eventCount>
<throttleMs>10</throttleMs>
<seed>timestamp</seed>
</hudson.plugins.android__emulator.monkey.MonkeyBuilder>
<hudson.tasks.Shell>
... distribution script
</hudson.tasks.Shell>
</builders>
<publishers>
<org.jenkinsci.plugins.android__lint.LintPublisher>
<healthy></healthy>
<thresholdLimit>low</thresholdLimit>
<pluginName>[android-lint] </pluginName>
<defaultEncoding></defaultEncoding>
<canRunOnFailed>false</canRunOnFailed>
<useStableBuildAsReference>false</useStableBuildAsReference>
<useDeltaValues>false</useDeltaValues>
<thresholds>
<unstableTotalAll></unstableTotalAll>
<unstableTotalHigh></unstableTotalHigh>
<unstableTotalNormal></unstableTotalNormal>
<unstableTotalLow></unstableTotalLow>
<unstableNewAll></unstableNewAll>
<unstableNewHigh></unstableNewHigh>
<unstableNewNormal></unstableNewNormal>
<unstableNewLow></unstableNewLow>
<failedTotalAll></failedTotalAll>
<failedTotalHigh></failedTotalHigh>
<failedTotalNormal></failedTotalNormal>
<failedTotalLow></failedTotalLow>
<failedNewAll></failedNewAll>
<failedNewHigh></failedNewHigh>
<failedNewNormal></failedNewNormal>
<failedNewLow></failedNewLow>
</thresholds>
<shouldDetectModules>false</shouldDetectModules>
<dontComputeNew>false</dontComputeNew>
<doNotResolveRelativePaths>false</doNotResolveRelativePaths>
<pattern></pattern>
</org.jenkinsci.plugins.android__lint.LintPublisher>
<hudson.plugins.checkstyle.CheckStylePublisher>
<healthy></healthy>
<unHealthy></unHealthy>
<thresholdLimit>low</thresholdLimit>
<pluginName>[CHECKSTYLE] </pluginName>
<defaultEncoding></defaultEncoding>
<canRunOnFailed>false</canRunOnFailed>
<useStableBuildAsReference>false</useStableBuildAsReference>
<useDeltaValues>false</useDeltaValues>
<thresholds>
<unstableTotalAll></unstableTotalAll>
<unstableTotalHigh></unstableTotalHigh>
<unstableTotalNormal></unstableTotalNormal>
<unstableTotalLow></unstableTotalLow>
<failedTotalAll></failedTotalAll>
<failedTotalHigh></failedTotalHigh>
<failedTotalNormal></failedTotalNormal>
<failedTotalLow></failedTotalLow>
</thresholds>
<shouldDetectModules>false</shouldDetectModules>
<dontComputeNew>true</dontComputeNew>
<doNotResolveRelativePaths>false</doNotResolveRelativePaths>
<pattern></pattern>
</hudson.plugins.checkstyle.CheckStylePublisher>
<hudson.plugins.warnings.WarningsPublisher>
<healthy></healthy>
<unHealthy></unHealthy>
<thresholdLimit>low</thresholdLimit>
<pluginName>[WARNINGS] </pluginName>
<defaultEncoding></defaultEncoding>
<canRunOnFailed>false</canRunOnFailed>
<useStableBuildAsReference>false</useStableBuildAsReference>
<useDeltaValues>false</useDeltaValues>
<thresholds>
<unstableTotalAll></unstableTotalAll>
<unstableTotalHigh></unstableTotalHigh>
<unstableTotalNormal></unstableTotalNormal>
<unstableTotalLow></unstableTotalLow>
<failedTotalAll></failedTotalAll>
<failedTotalHigh></failedTotalHigh>
<failedTotalNormal></failedTotalNormal>
<failedTotalLow></failedTotalLow>
</thresholds>
<shouldDetectModules>false</shouldDetectModules>
<dontComputeNew>true</dontComputeNew>
<doNotResolveRelativePaths>true</doNotResolveRelativePaths>
<parserConfigurations/>
<consoleParsers>
<hudson.plugins.warnings.ConsoleParser>
<parserName>Java Compiler (Eclipse)</parserName>
</hudson.plugins.warnings.ConsoleParser>
</consoleParsers>
</hudson.plugins.warnings.WarningsPublisher>
<hudson.plugins.analysis.collector.AnalysisPublisher>
<healthy></healthy>
<unHealthy></unHealthy>
<thresholdLimit>low</thresholdLimit>
<pluginName>[ANALYSIS-COLLECTOR] </pluginName>
<defaultEncoding></defaultEncoding>
<canRunOnFailed>false</canRunOnFailed>
<useStableBuildAsReference>false</useStableBuildAsReference>
<useDeltaValues>false</useDeltaValues>
<thresholds>
<unstableTotalAll></unstableTotalAll>
<unstableTotalHigh></unstableTotalHigh>
<unstableTotalNormal></unstableTotalNormal>
<unstableTotalLow></unstableTotalLow>
<failedTotalAll></failedTotalAll>
<failedTotalHigh></failedTotalHigh>
<failedTotalNormal></failedTotalNormal>
<failedTotalLow></failedTotalLow>
</thresholds>
<shouldDetectModules>false</shouldDetectModules>
<dontComputeNew>true</dontComputeNew>
<doNotResolveRelativePaths>true</doNotResolveRelativePaths>
<isCheckStyleDeactivated>false</isCheckStyleDeactivated>
<isDryDeactivated>true</isDryDeactivated>
<isFindBugsDeactivated>true</isFindBugsDeactivated>
<isPmdDeactivated>true</isPmdDeactivated>
<isOpenTasksDeactivated>true</isOpenTasksDeactivated>
<isWarningsDeactivated>false</isWarningsDeactivated>
</hudson.plugins.analysis.collector.AnalysisPublisher>
<hudson.plugins.android__emulator.monkey.MonkeyRecorder>
<failureOutcome>FAILURE</failureOutcome>
</hudson.plugins.android__emulator.monkey.MonkeyRecorder>
<hudson.plugins.cigame.GamePublisher/>
<hudson.tasks.Mailer>
<recipients></recipients>
<dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
<sendToIndividuals>true</sendToIndividuals>
</hudson.tasks.Mailer>
</publishers>
<buildWrappers>
<hudson.plugins.locksandlatches.LockWrapper>
<locks>
<hudson.plugins.locksandlatches.LockWrapper_-LockWaitConfig>
<name>AndroidEmulator</name>
</hudson.plugins.locksandlatches.LockWrapper_-LockWaitConfig>
</locks>
</hudson.plugins.locksandlatches.LockWrapper>
<hudson.plugins.android__emulator.AndroidEmulator>
<osVersion>Google Inc.:Google APIs:8</osVersion>
<screenDensity>240</screenDensity>
<screenResolution>480x720</screenResolution>
<deviceLocale>de_DE</deviceLocale>
<sdCardSize>200M</sdCardSize>
<hardwareProperties>
<hudson.plugins.android__emulator.AndroidEmulator_-HardwareProperty>
<key>hw.ramSize</key>
<value>512</value>
</hudson.plugins.android__emulator.AndroidEmulator_-HardwareProperty>
</hardwareProperties>
<wipeData>false</wipeData>
<showWindow>true</showWindow>
<useSnapshots>true</useSnapshots>
<deleteAfterBuild>false</deleteAfterBuild>
<startupDelay>0</startupDelay>
<commandLineOptions></commandLineOptions>
</hudson.plugins.android__emulator.AndroidEmulator>
</buildWrappers>
</project>
A bug was introduced in SDK Tools r20, whereby trying to list the available snapshots (via the emulator -snapshot-list command) would result in a crash.
Since the command crashes without listing the available snapshots, the Android Emulator Plugin believes that there are no existing snapshots, which causes a new snapshot to be created in every build.
I discovered that these crashes only occur with certain versions of the emulator application, i.e. it is possible to avoid the crash.
Thankfully, the Jenkins plugin lets you select the emulator binary to run.
So you can work around this problem by going into your job configuration, pressing Advanced… in the emulator config and selecting the "emulator-arm" (or another) binary.
In addition to Christopher Orr's answer, there is another possible cause. In my environment, emulator -snapshot-list listed the size of my snapshot as "1.0G". The pattern that matches snapshots in the Android Emulator Plugin as of 2014-01-14 matches whole number megabyte values.
I submitted a pull request to address that cause.

Categories

Resources