When I run test on Jenkins with option create emulator I have this problem:
[android] Could not create Android emulator: Failed to run AVD
creation command
When I target 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) at
java.io.FileInputStream.open(Native Method) at
java.io.FileInputStream.(Unknown Source) at
java.io.FileReader.(Unknown Source) at
hudson.plugins.android_emulator.util.Utils.parseConfigFile(Utils.java:436)
at
hudson.plugins.android_emulator.SdkInstaller$2.call(SdkInstaller.java:331)
at
hudson.plugins.android_emulator.SdkInstaller$2.call(SdkInstaller.java:328)
at hudson.remoting.LocalChannel.call(LocalChannel.java:45) at
hudson.plugins.android_emulator.SdkInstaller.getPlatformFromExistingEmulator(SdkInstaller.java:328)
at
hudson.plugins.android_emulator.SdkInstaller.getPlatformForEmulator(SdkInstaller.java:312)
at
hudson.plugins.android_emulator.SdkInstaller.installDependencies(SdkInstaller.java:174)
at
hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:247)
at hudson.model.Build$BuildExecution.doRun(Build.java:154) at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
at hudson.model.Run.execute(Run.java:1488) at
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at
hudson.model.ResourceController.execute(ResourceController.java:88) at
hudson.model.Executor.run(Executor.java:236)
I have this file.
When I run manual emulator and tests on jenkins It works.
The path shown in the second case suggests that you may be running Jenkins as a system service.
In which case, you could try the workaround listed under “Known Issues” on the Android Emulator Plugin wiki page:
If that doesn’t solve the problem, can you tell us in which directory AVDs are placed when you create them manually? You can find out by running
emulatorwith the-verboseflag. Within the first few lines you should see something like: