Android Emulator plugin not working in Jenkins

When I run a test on Jenkins using the create emulator option, I have this problem:

[android] Failed to create Android emulator: failed to launch AVD create command

When I aim at an existing emulator, I have this problem:

FATAL: C: \ Windows \ system32 \ config \ systemprofile.android \ avd \ AVD_2.2.ini (the system cannot find the path specified) java.io.FileNotFoundException: C: \ Windows \ system32 \ config \ systemprofile.android \ avd \ AVD_2.2.ini (the system cannot find the path specified) java.io.FileInputStream.open (native method) in java.io.FileInputStream. (Unknown source) in java.io.FileReader. (Unknown source) in hudson.plugins.android_emulator.util.Utils.parseConfigFile (Utils.java:436) in hudson.plugins.android_emulator.SdkInstaller $ 2.call (SdkInstaller.javahaps31) in hudson.plugins.android_emulator.S .call (SdkInstaller.java:328) at hudson.remoting.LocalChannel.call (LocalChannel.java:45) at hudson.plugins.android_emulator.SdkInstaller.getPlatformFromExistingEmulator (SdkInstaller.java:328) in hudson.ulator. getPlatformForEmulator (SdkInstaller.javahaps12) in hudson.plugins.android_emulator.SdkInstaller.installDependencies (SdkInstaller.java:174) in hudson.plugins.android_emulator.AndroidEmulator.setUp (AndroidEmulator.javaild.m .doRun (Build.java:154) in hudson.model.AbstractBuild $ AbstractBuildExecution.run (AbstractBuild.java:499) in hudson.model.Run.execute (Run.java:1488) in hudson.model.FreeStyleBuild.run ( FreeStyleBuild.java:46) in hudson.model.ResourceController.execute (Res ourceController.java:88) in hudson.model.Executor.run (Executor.java:236)

I have this file. When I run the manual emulator and tests on jenkins, it works.

+4
source share
1 answer

The path shown in the second case assumes that you can run Jenkins as a system service.

In this case, you can try the workaround indicated in the Known Issues section of the Android plugin-vinyl emulator page:

Work in the Windows service as the "Local System"
New AVDs cannot be created and started if Jenkins runs as a Windows service using the "Local System" account (see issue # 7355 ).

Workaround: Configure the Jenkins service to "start" as a "real user"


If this does not solve the problem, can you tell us in which directory the AVDs are placed when they are created manually? You can find out by running emulator with the -verbose flag. In the first few lines you should see something like:

emulator: Android virtual device file at: c: \ users \ foo \ .android \ avd \ emu_4.0.3.ini

+9
source

All Articles