Android Emulator插件在Jenkins中不起作用 [英] Android Emulator plugin not working in Jenkins

查看:527
本文介绍了Android Emulator插件在Jenkins中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在带有选项create emulator的Jenkins上运行测试时,我遇到了这个问题:

When I run test on Jenkins with option create emulator I have this problem:

[android]无法创建Android模拟器:无法运行AVD 创建命令

[android] Could not create Android emulator: Failed to run AVD creation command

当我定位现有的模拟器时,我会遇到以下问题:

When I target existing emulator I have this problem:

致命: C:\ Windows \ system32 \ config \ systemprofile.android \ avd \ AVD_2.2.ini( 系统找不到指定的路径)java.io.FileNotFoundException: C:\ Windows \ system32 \ config \ systemprofile.android \ avd \ AVD_2.2.ini( 系统找不到指定的路径) java.io.FileInputStream.open(本机方法),位于 java.io.FileInputStream.(未知源) java.io.FileReader.(未知源)在 hudson.plugins.android_emulator.util.Utils.parseConfigFile(Utils.java:436) 在 hudson.plugins.android_emulator.SdkInstaller $ 2.call(SdkInstaller.java:331) 在 hudson.plugins.android_emulator.SdkInstaller $ 2.call(SdkInstaller.java:328) 在hudson.remoting.LocalChannel.call(LocalChannel.java:45)处 hudson.plugins.android_emulator.SdkInstaller.getPlatformFromExistingEmulator(SdkInstaller.java:328) 在 hudson.plugins.android_emulator.SdkInstaller.getPlatformForEmulator(SdkInstaller.java:312) 在 hudson.plugins.android_emulator.SdkInstaller.installDependencies(SdkInstaller.java:174) 在 hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:247) 在hudson.model.Build $ BuildExecution.doRun(Build.java:154)处 hudson.model.AbstractBuild $ AbstractBuildExecution.run(AbstractBuild.java:499) 在hudson.model.Run.execute(Run.java:1488)处 hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)在 hudson.model.ResourceController.execute(ResourceController.java:88)在 hudson.model.Executor.run(Executor.java:236)

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)

我有这个文件. 当我在jenkins上运行手动模拟器并进行测试时,它可以工作.

I have this file. When I run manual emulator and tests on jenkins It works.

推荐答案

第二种情况下显示的路径表明您可能正在将Jenkins作为系统服务运行.

The path shown in the second case suggests that you may be running Jenkins as a system service.

在这种情况下,您可以尝试在 Android Emulator Plugin Wiki页面:

In which case, you could try the workaround listed under "Known Issues" on the Android Emulator Plugin wiki page:

在Windows服务中作为本地系统"运行
如果Jenkins使用本地系统"帐户作为Windows服务运行,则无法生成并运行新的AVD(请参阅 issue #7355 ).

Running in a Windows service as "Local System"
New AVDs cannot be generated and run if Jenkins is running as a Windows service, using the "Local System" account (see issue #7355).

解决方法:将Jenkins服务配置为以实际用户身份运行"

Workaround: configure the Jenkins service to "run as" a real user


如果这不能解决问题,当手动创建AVD时,您能否告诉我们将AVD放在哪个目录中?您可以通过使用-verbose标志运行emulator来查找.在前几行中,您应该会看到类似以下内容的


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 emulator with the -verbose flag. Within the first few lines you should see something like:

模拟器:位于以下位置的Android虚拟设备文件:c:\ users \ foo \ .android \ avd \ emu_4.0.3.ini

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

这篇关于Android Emulator插件在Jenkins中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆