[JIRA] Created: (JENKINS-9623) "Failed to run AVD creation command" on Linux

714 views
Skip to first unread message

davemani5@java.net (JIRA)

unread,
May 8, 2011, 12:35:17 PM5/8/11
to jenkinsc...@googlegroups.com
"Failed to run AVD creation command" on Linux
---------------------------------------------

Key: JENKINS-9623
URL: https://issues.jenkins-ci.org/browse/JENKINS-9623
Project: Jenkins
Issue Type: Bug
Components: android-emulator
Environment: Fedora Linux i686, Hudson ver. 1.396, Android Emulator Plugin v. 1.6, Xvnc + Xvnc Plugin (setup as described in http://groups.google.com/group/robotium-developers/browse_thread/thread/af0cce19514e4018/029953a677a81bd6)
Reporter: davemani5
Assignee: orrc


I am trying to create an avd using the android emulator plugin ("Run emulator with properties" option) but I receive an error stating "Could not create Android emulator: Failed to run AVD creation command." I am unsure how to trouble shoot this problem as everything appears to be set up correctly according to the wiki page. Here is the log:


Starting xvnc
[workspace] $ Xvnc :58 -localhost -geometry 1280x1024 -depth 24 -SecurityTypes None
[android] Using Android SDK: /var/android/android-sdk-linux_x86/
[android] Creating Android AVD at /.android/avd/hudson_en-US_160_HVGA_android-4.avd
[android] Failed to run AVD creation command

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

Xvnc Free Edition 4.1.2
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 10300000, The X.Org Foundation

Sun May 8 09:49:00 2011
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5958
vncext: created VNC server for screen 0
Finished: NOT_BUILT


I tracked down where this is failing in the code to https://github.com/jenkinsci/android-emulator-plugin/blob/master/src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java#L463 . We also ran "android create avd -c 32M -s 320x480 -n hudson_en-US_160_HVGA_android-4 -t 2" from the command line and it works fine (prompted for a create custom hardware profile though). Unfortunately, this was not enough information to figure out what is wrong. A corollary to this problem is that the android emulator plugin should have the option to run android creation commands with the -v (verbosity) turned on as described by http://developer.android.com/guide/developing/tools/android.html.

To recap, I think this "failed to run AVD creation command" is a bug with how Android Emulator Plugin uses the creation command. I also felt logging the -v option would have been tremendously helpful for troubleshooting. I can log this portion as a separate enhancement if need be.

Thanks and please let me know if I can provide any more information.

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


chris@orr.me.uk (JIRA)

unread,
May 8, 2011, 1:05:17 PM5/8/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148468#comment-148468 ]

orrc commented on JENKINS-9623:
-------------------------------

I notice from the log that it says "Creating Android AVD at /.android/...", which normally I'd expect to be "/home/user/.android/...".
Which user are you running Hudson as, and does that user have an ANDROID_SDK_HOME property set?

Since the plugin uses the same algorithm as the Android SDK to determine the ".android" directory, I would guess that your Hudson user cannot write to the /.android directory.

Can you run the "android create avd" command from within Hudson? i.e. Add a "Execute shell script" option with the command line you mention above, and uncheck the Android plugin option? Does that succeed?

Regarding verbose output, I didn't see useful extra output when looking very quickly just now, but I can certainly check further if you post an issue.

davemani5@java.net (JIRA)

unread,
May 8, 2011, 2:14:18 PM5/8/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148470#comment-148470 ]

davemani5 commented on JENKINS-9623:
------------------------------------

Thanks for the quick response orrc. You have been a great help with issues we have seen so far and I just wanted to thank you for helping us try to figure out this one also.

As for your response, I am fairly certain I am running Hudson as a user named "hudson". Is there an easier way to determine this other than to figure out what web server or servlet container (such as Tomcat) Hudson is deployed on?

The hudson user did not have the ANDROID_SDK_HOME property set, so I went ahead and set that for the all users. (I thought this wasn't necessary though as I previously set my Android SDK root to /var/android/android-sdk-linux_x86/.) I also gave the user rights to the /.android directory (which did not exist, so I created it). Then I restarted my Hudson instance.

After doing these steps I still got the "Failed to run AVD creation command" message. It appears that I have a bit more information now in the output (although I am fairly certain java is correctly defined for my environment & hudson):


[android] Using Android SDK: /var/android/android-sdk-linux_x86/

[android] Creating Android AVD at /.android/avd/hudson_en-US_160_HVGA_android-7.avd


[android] Failed to run AVD creation command

/var/android/android-sdk-linux_x86//tools/android: line 83: java: command not found
/var/android/android-sdk-linux_x86//tools/android: line 93: java: command not found
/var/android/android-sdk-linux_x86//tools/android: line 113: exec: java: not found



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


I also ran through the "Execute shell script" as suggested. I'm not sure how to interpret this result as I think you have a catch for the custom hardware profile prompt:


Starting xvnc
[workspace] $ Xvnc :10 -localhost -geometry 1280x1024 -depth 24 -SecurityTypes None
[workspace] $ /bin/sh -xe /usr/local/hudson/apache-tomcat-6.0.20/temp/hudson643.sh

Xvnc Free Edition 4.1.2
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 10300000, The X.Org Foundation

Sun May 8 14:00:08 2011
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5910


vncext: created VNC server for screen 0

+ /var/android/android-sdk-linux_x86/tools/android create avd -c 32M -s 320x480 -n hudson_en-US_160_HVGA_android-4 -t 2 --force
Android 1.6 is a basic Android platform.
Do you wish to create a custom hardware profile [no]Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.checkBounds(String.java:397)
at java.lang.String.<init>(String.java:569)
at com.android.sdkmanager.Main.readLine(Main.java:1287)
at com.android.sdkmanager.Main.promptForHardware(Main.java:1163)
at com.android.sdkmanager.Main.createAvd(Main.java:972)
at com.android.sdkmanager.Main.doAction(Main.java:230)
at com.android.sdkmanager.Main.run(Main.java:99)
at com.android.sdkmanager.Main.main(Main.java:88)
Terminating xvnc.
Finished: FAILURE

Do you have any ideas on where to go from here?

chris@orr.me.uk (JIRA)

unread,
May 8, 2011, 7:00:17 PM5/8/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148476#comment-148476 ]

orrc commented on JENKINS-9623:
-------------------------------

Thanks for the response.

You don't need to set the ANDROID_SDK_HOME variable; that was just for my info, as it can affect where Android stores emulators. In this case, I guess your "hudson" user has its home directory set as "/" in /etc/passwd.

When creating an emulator, the plugin should always output the reason why the AVD creation command failed. You did get the informative "java: command not found" output, but not the first time.. there seems to be a race condition in the plugin.

Anyway, given that AVD creation fails when run from the plugin, but succeeds when run via "Execute shell", I would guess that could be an environment problem. Though I'm not sure how that could be the case.. the "android" script uses /bin/sh and so does the "Execute shell" option, so both should have access to the same paths etc..

Examining how Hudson is run and the PATH it uses during job execution could be helpful. Could you go to Manage Hudson > Script Console and post the output of this script?

println(hudson.model.Hudson.instance.getRootPath())
println(System.getProperty("user.name"))
println(System.getenv("PATH"))


P.S. This plugin is now at version 1.13 with a number of new features -- Hudson hasn't been displaying newer versions for some reason since everyone moved to Jenkins. Switching to Jenkins is a seamless upgrade, in case you're interested :)

davemani5@java.net (JIRA)

unread,
May 8, 2011, 7:32:17 PM5/8/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148477#comment-148477 ]

davemani5 commented on JENKINS-9623:
------------------------------------

Thanks Orrc. Switching to Jenkins is on our todo. I figured I would get our Hudson instance working before switching (as we already have a working hudson instance on windows, we figured this would be easier). If you think that these new features will fix this issue, we will switch to Jenkins before going any further troubleshooting this issue.

As for the output of that script here is what we got:

/usr/local/hudson/hudson-home
root
/sbin:/usr/sbin:/bin:/usr/bin

Not quite sure why our PATH is not fully set and why it doesn't contain our our variables set up in our .bash_profile script. This path discrepancy explains why when we log in as root all these commands work fine. What do you suggest doing from here? I'm assuming I need to change whatever script hudson calls when it sets up the PATH for the root user.

chris@orr.me.uk (JIRA)

unread,
May 9, 2011, 5:54:35 PM5/9/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148492#comment-148492 ]

orrc commented on JENKINS-9623:
-------------------------------

I wouldn't imagine upgrading the plugin (or Jenkins) would help -- it just sounds like an environment issue.

Firstly, I imagine it's not advisable to run apps like Tomcat or Hudson as the root user, but at least that shouldn't have any affect on this Hudson problem.

Secondly, how and where have you installed Java? If it was from Fedora packages, I would expect all the links to `java` and `javac` and similar would be automatically placed into somewhere accessible by all users (e.g. /usr/bin).

If not, and Java is installed elsewhere, perhaps you could try adding the Java bin directory to PATH in /etc/environment to ensure these paths are set system-wide.

Beyond that, I'm not really sure what else to suggest...

davemani5@java.net (JIRA)

unread,
May 10, 2011, 6:20:34 PM5/10/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148551#comment-148551 ]

davemani5 commented on JENKINS-9623:
------------------------------------

Thanks orrc. Your comments put me back on the right track. It appears that my /usr/bin/java & javac were incorrectly set up (wrong symbolic links).

I now get a different but at least more precise error message, "Failed to parse AVD config file." The code says it throws that message for ioexceptions, so is this a permission issue? If so, do you know what I should modify (avd config file or certain directories)? Here is the log:

Starting xvnc
[workspace] $ Xvnc :10 -localhost -geometry 1280x1024 -depth 24 -SecurityTypes None


[android] Using Android SDK: /var/android/android-sdk-linux_x86/

[android] Creating Android AVD at /.android/avd/hudson_en-US_160_HVGA_android-7.avd

Xvnc Free Edition 4.1.2
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 10300000, The X.Org Foundation


Mon May 9 19:37:07 2011
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5910


vncext: created VNC server for screen 0

[android] Could not create Android emulator: Failed to parse AVD config file
Terminating xvnc.
Finished: NOT_BUILT

chris@orr.me.uk (JIRA)

unread,
May 10, 2011, 6:54:34 PM5/10/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148560#comment-148560 ]

orrc commented on JENKINS-9623:
-------------------------------

Hmm.. I should give more info with that error message!

But I believe that's happening because the "android" command line tool is creating your AVD in somewhere other than the path the plugin expects (i.e. the "/.android/avd/..." directory). Therefore it can't read the config file.

Can you see if the AVD was created under /root/.android/avd rather than /.android/avd? If that's the case you could just symlink /.android to /root/.android -- though it doesn't answer the question *why* this is happening.

Can you paste this output, please?

println(System.getProperty("user.name"))
println(System.getProperty("user.home"))
println(System.getenv("ANDROID_SDK_HOME"))
println(System.getenv("HOME"))
println(System.getenv("USER"))


Also, what's the output of this command (SDK tools version)?
grep Revision /var/android/android-sdk-linux_x86/tools/source.properties

davemani5@java.net (JIRA)

unread,
May 10, 2011, 11:30:34 PM5/10/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148574#comment-148574 ]

davemani5 commented on JENKINS-9623:
------------------------------------

Thanks orrc, I agree that error message could use some extra logging. As for your response, it looks like you are right and it is creating the avd in /root/.android/avd instead of /.android/avd. I see several avds created in there. I went ahead and created the symbolic link like you mentioned. That gets me around the previous error but now the log says it times out. Here is the build log:

Starting xvnc
[workspace] $ Xvnc :10 -localhost -geometry 1280x1024 -depth 24 -SecurityTypes None


[android] Using Android SDK: /var/android/android-sdk-linux_x86/

[android] Waiting 6 seconds before starting emulator...

Xvnc Free Edition 4.1.2
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 10300000, The X.Org Foundation

Tue May 10 20:44:19 2011
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5910


vncext: created VNC server for screen 0

[android] Starting Android emulator
$ /var/android/android-sdk-linux_x86//tools/emulator -ports 46221,48420 -no-boot-anim -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_HVGA_android-7 -no-window
emulator: warning: opening audio output failed

$ /var/android/android-sdk-linux_x86//platform-tools/adb connect localhost:48420
$ /var/android/android-sdk-linux_x86//platform-tools/adb -s localhost:48420 logcat -v time
[android] Waiting for emulator to finish booting...
$ /var/android/android-sdk-linux_x86//platform-tools/adb -s localhost:48420 shell getprop dev.bootcomplete
$ /var/android/android-sdk-linux_x86//platform-tools/adb -s localhost:48420 shell getprop dev.bootcomplete
$ /var/android/android-sdk-linux_x86//platform-tools/adb -s localhost:48420 shell getprop dev.bootcomplete
$ /var/android/android-sdk-linux_x86//platform-tools/adb -s localhost:48420 shell getprop dev.bootcomplete
$ /var/android/android-sdk-linux_x86//platform-tools/adb -s localhost:48420 shell getprop dev.bootcomplete
$ /var/android/android-sdk-linux_x86//platform-tools/adb -s localhost:48420 shell getprop dev.bootcomplete
$ /var/android/android-sdk-linux_x86//platform-tools/adb -s localhost:48420 shell getprop dev.bootcomplete
[android] Timed-out after waiting 120 seconds for emulator
$ /var/android/android-sdk-linux_x86//platform-tools/adb disconnect localhost:48420
[android] Stopping Android emulator
[android] Archiving emulator log
Terminating xvnc.
Finished: NOT_BUILT


FYI- I think I just need more time to start the emulator. When I set it to an existing emulator it said "[android] Emulator is ready for use (took 211 seconds)."

As for the info you requested, the output of those println commands is rather strange. (I did add java, ANDROID_SDK_HOME, etc. to my /etc/environment like you previously suggested FYI) Here is the output of the println commands you asked for:
root
/root
null
/
null

I'm not sure how to configure these environment variables for my root user. I thought these would be configured by scripts because they are defined when I log in as root.
Also here is the SDK tool version:
Pkg.Revision=10

chris@orr.me.uk (JIRA)

unread,
May 11, 2011, 7:33:34 PM5/11/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148625#comment-148625 ]

orrc commented on JENKINS-9623:
-------------------------------

Ok, thanks for the info. From what I can see, the plugin checks your "HOME" variable (which is "/" for you), but the android tool creates AVDs based on the Java "user.home" property (which is "/root" for you).

Why those two values differ, I don't know -- though in general I would say it's odd that your HOME variable is "/". Is that really what it says in /etc/passwd for the root user?

Anyway, I can fix that issue (although there's a subtle bug in the emulator itself which would still break things in this situation), but at least you have the workaround of symlinking the directories to fix all of this.


About the timeout during AVD startup, I'm surprised that it takes so long -- 211 seconds to start an already-existing emulator? Did you have the "erase data" option enabled? Do you have a very slow, or overloaded machine?

Normally, starting an emulator for the first time does take a while, so the timeout is automatically increased from 120 seconds to 480 seconds in that case.
But I just created an identical emulator on my aging four year-old MacBook and it started for the first time in 140 seconds. Starting it for the second time took 40 seconds.

In this case I'd recommend deleting your existing /root/.android/avd/hudson_* emulators and trying again.

Also, if you upgrade to version 1.10 or higher of the plugin, you'll get AVD snapshot support -- this means emulators start up in the range of 4 to 20 seconds. Even although Hudson probably doesn't show the update, you can download the latest release and upload it via Plugins > Advanced: http://updates.jenkins-ci.org/latest/android-emulator.hpi

davemani5@java.net (JIRA)

unread,
May 16, 2011, 10:58:35 PM5/16/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148770#comment-148770 ]

davemani5 commented on JENKINS-9623:
------------------------------------

Thanks orrc, the combination of deleting my existing /root/.android/avd/hudson emulators and upgrading to the newer version to use snapshot support fixed this problem for me. The android emulator is now launching as part of my hudson build.

FYI- I am using an amazon ec2 micro instance which I thought would be fast enough based on it's description. I did not have the "erase data" option checked.

Also, I do not know how to check /etc/passwd for the HOME variable but i agree this is odd it is configured this way.

Once again, thank you so much for your help. I really don't think I could have gotten this far without all your help.

> "Failed to run AVD creation command" on Linux
> ---------------------------------------------
>
> Key: JENKINS-9623
> URL: https://issues.jenkins-ci.org/browse/JENKINS-9623
> Project: Jenkins
> Issue Type: Bug
> Components: android-emulator
> Environment: Fedora Linux i686, Hudson ver. 1.396, Android Emulator Plugin v. 1.6, Xvnc + Xvnc Plugin (setup as described in http://groups.google.com/group/robotium-developers/browse_thread/thread/af0cce19514e4018/029953a677a81bd6)
> Reporter: davemani5

> Assignee: Christopher Orr

davemani5@java.net (JIRA)

unread,
May 18, 2011, 8:29:34 PM5/18/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148804#comment-148804 ]

davemani5 commented on JENKINS-9623:
------------------------------------

Perhaps I spoke too soon with my last message. I am, however, getting much closer to having a working Hudson build with the android emulator plugin as my emulator is launching now.

I currently am getting error stating, "org.apache.maven.BuildFailureException: Tests failed on device." I'm fairly certain this error is on the android emulator side due to the logcat which is below:


05-12 02:08:50.550 D/AndroidRuntime( 201): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
05-12 02:08:50.558 D/AndroidRuntime( 201): CheckJNI is ON
05-12 02:08:50.730 D/AndroidRuntime( 201): --- registering native functions ---
05-12 02:08:51.420 D/ActivityManager( 146): Uninstalling process com.bubblewaretechnology.martinilocker
05-12 02:08:51.440 I/ActivityManager( 146): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=android/com.android.internal.app.ResolverActivity }
05-12 02:08:51.448 E/ActivityManager( 146): Activity Manager Crash
05-12 02:08:51.448 E/ActivityManager( 146): java.lang.NullPointerException
05-12 02:08:51.448 E/ActivityManager( 146): at com.android.server.am.ActivityManagerService.startActivityLocked(ActivityManagerService.java:2965)
05-12 02:08:51.448 E/ActivityManager( 146): at com.android.server.am.ActivityManagerService.startActivityUncheckedLocked(ActivityManagerService.java:3625)
05-12 02:08:51.448 E/ActivityManager( 146): at com.android.server.am.ActivityManagerService.startActivityLocked(ActivityManagerService.java:3266)
05-12 02:08:51.448 E/ActivityManager( 146): at com.android.server.am.ActivityManagerService.startHomeActivityLocked(ActivityManagerService.java:2475)
05-12 02:08:51.448 E/ActivityManager( 146): at com.android.server.am.ActivityManagerService.resumeTopActivityLocked(ActivityManagerService.java:2579)
05-12 02:08:51.448 E/ActivityManager( 146): at com.android.server.am.ActivityManagerService.uninstallPackageLocked(ActivityManagerService.java:5154)
05-12 02:08:51.448 E/ActivityManager( 146): at com.android.server.am.ActivityManagerService.startInstrumentation(ActivityManagerService.java:12690)
05-12 02:08:51.448 E/ActivityManager( 146): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:666)
05-12 02:08:51.448 E/ActivityManager( 146): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1539)
05-12 02:08:51.448 E/ActivityManager( 146): at android.os.Binder.execTransact(Binder.java:287)
05-12 02:08:51.448 E/ActivityManager( 146): at dalvik.system.NativeStart.run(Native Method)
05-12 02:08:51.460 E/AndroidRuntime( 146): Crash logging skipped, no checkin service
05-12 02:08:51.468 I/AndroidRuntime( 201): AndroidRuntime onExit calling exit(1)


Do you have any suggestions here? My gut is telling me your advice in this stack overflow question (http://stackoverflow.com/questions/3214531/how-to-send-key-events-to-a-headless-emulator-in-an-instrumentation-test/3366443#3366443) is applicable here but I'm not sure how to apply this advice to my current situation.


> "Failed to run AVD creation command" on Linux
> ---------------------------------------------
>
> Key: JENKINS-9623
> URL: https://issues.jenkins-ci.org/browse/JENKINS-9623
> Project: Jenkins
> Issue Type: Bug
> Components: android-emulator
> Environment: Fedora Linux i686, Hudson ver. 1.396, Android Emulator Plugin v. 1.6, Xvnc + Xvnc Plugin (setup as described in http://groups.google.com/group/robotium-developers/browse_thread/thread/af0cce19514e4018/029953a677a81bd6)
> Reporter: davemani5

> Assignee: Christopher Orr

chris@orr.me.uk (JIRA)

unread,
May 19, 2011, 6:27:34 PM5/19/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148840#comment-148840 ]

Christopher Orr commented on JENKINS-9623:
------------------------------------------

Do these unit tests run ok when you start them manually in the emulator (i.e. not inside Hudson)?

I don't believe the stack trace above has anything to do with not being able to press keys; normally that error message is much more obvious.

More likely, I think it's related to attempting to launch an alternative home screen. Since there's always already a home screen installed, you instead get the "intent resolved" popup (com.android.internal.app.ResolverActivity) when trying to start your app. I would guess unit tests wouldn't take kindly to that and therefore crash since the expected Activity (i.e. the one you want to test) didn't actually start up.

I don't know what exactly you're doing now, but can you start your main Activity in another way, e.g. putting its class name in an Intent?

> "Failed to run AVD creation command" on Linux
> ---------------------------------------------
>
> Key: JENKINS-9623
> URL: https://issues.jenkins-ci.org/browse/JENKINS-9623
> Project: Jenkins
> Issue Type: Bug
> Components: android-emulator
> Environment: Fedora Linux i686, Hudson ver. 1.396, Android Emulator Plugin v. 1.6, Xvnc + Xvnc Plugin (setup as described in http://groups.google.com/group/robotium-developers/browse_thread/thread/af0cce19514e4018/029953a677a81bd6)
> Reporter: davemani5

> Assignee: Christopher Orr

davemani5@java.net (JIRA)

unread,
May 20, 2011, 9:16:34 AM5/20/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148857#comment-148857 ]

davemani5 commented on JENKINS-9623:
------------------------------------

Thanks once again for the response. I have a Hudson instance on windows set up and it runs through these tests successfully. That was another reason I thought it was dealing with the xvnc/android emulator plugin on my fedora linux box.

My application that I'm testing is technically an alternative home screen. My unit tests, however, are testing the functionality of launching the main app which launches "normally" as a list of programs.

This error appears to occur using android.test.InstrumentationTestRunner in my emulator instance. The log says I get errors running the command:

/var/android/android-sdk-linux_x86/platform-tools/adb shell am instrument -w
com.bubblewaretechnology.martinilocker.test/android.test.InstrumentationTestRunner

Returns an exception:
java.lang.NullPointerException

Do you know how this error message may be relating to the logcat I previously posted? Or how this nullpointerexception can be fixed for the IntstrumentationTestRunner? Your feedback always appears to put me back on the right track here :)

> "Failed to run AVD creation command" on Linux
> ---------------------------------------------
>
> Key: JENKINS-9623
> URL: https://issues.jenkins-ci.org/browse/JENKINS-9623
> Project: Jenkins
> Issue Type: Bug
> Components: android-emulator
> Environment: Fedora Linux i686, Hudson ver. 1.396, Android Emulator Plugin v. 1.6, Xvnc + Xvnc Plugin (setup as described in http://groups.google.com/group/robotium-developers/browse_thread/thread/af0cce19514e4018/029953a677a81bd6)
> Reporter: davemani5

> Assignee: Christopher Orr

mazur.roman@gmail.com (JIRA)

unread,
Jul 8, 2011, 8:32:34 AM7/8/11
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=150284#comment-150284 ]

Roman Mazur commented on JENKINS-9623:
--------------------------------------

We have a similar problem. AVD is not created...

[android] Using Android SDK: /opt/android-sdk-linux_86
[android] Creating Android AVD: /opt/integration/hudson/.android/avd/hudson_en-US_160_HVGA_android-7.avd


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

Finished: NOT_BUILT

user.home=USER=/opt/integration/hudson

We are trying remote build on the slave.

> "Failed to run AVD creation command" on Linux
> ---------------------------------------------
>
> Key: JENKINS-9623
> URL: https://issues.jenkins-ci.org/browse/JENKINS-9623
> Project: Jenkins
> Issue Type: Bug
> Components: android-emulator
> Environment: Fedora Linux i686, Hudson ver. 1.396, Android Emulator Plugin v. 1.6, Xvnc + Xvnc Plugin (setup as described in http://groups.google.com/group/robotium-developers/browse_thread/thread/af0cce19514e4018/029953a677a81bd6)
> Reporter: davemani5

> Assignee: Christopher Orr

globule71

unread,
Jul 8, 2011, 8:33:41 AM7/8/11
to jenkinsc...@googlegroups.com
Je suis absent du bureau du 30 Juin au 15 Juillet,
 
En cas d'urgence merci de contacter directement le support : [hidden email]

Ou une des personnes suivantes :
[hidden email]
[hidden email]


View this message in context: Absence du bureau : [JIRA] Commented: (JENKINS-9623) "Failed to run AVD creation command" on Linux
Sent from the Jenkins issues mailing list archive at Nabble.com.

chris@orr.me.uk (JIRA)

unread,
Jan 13, 2012, 11:59:51 AM1/13/12
to jenkinsc...@googlegroups.com

[ https://issues.jenkins-ci.org/browse/JENKINS-9623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Orr resolved JENKINS-9623.
--------------------------------------

Resolution: Incomplete



> "Failed to run AVD creation command" on Linux
> ---------------------------------------------
>
> Key: JENKINS-9623
> URL: https://issues.jenkins-ci.org/browse/JENKINS-9623
> Project: Jenkins
> Issue Type: Bug
> Components: android-emulator
> Environment: Fedora Linux i686, Hudson ver. 1.396, Android Emulator Plugin v. 1.6, Xvnc + Xvnc Plugin (setup as described in http://groups.google.com/group/robotium-developers/browse_thread/thread/af0cce19514e4018/029953a677a81bd6)
> Reporter: davemani5

> Assignee: Christopher Orr


>
> I am trying to create an avd using the android emulator plugin ("Run emulator with properties" option) but I receive an error stating "Could not create Android emulator: Failed to run AVD creation command." I am unsure how to trouble shoot this problem as everything appears to be set up correctly according to the wiki page. Here is the log:
> Starting xvnc
> [workspace] $ Xvnc :58 -localhost -geometry 1280x1024 -depth 24 -SecurityTypes None
> [android] Using Android SDK: /var/android/android-sdk-linux_x86/
> [android] Creating Android AVD at /.android/avd/hudson_en-US_160_HVGA_android-4.avd
> [android] Failed to run AVD creation command
>
> [android] Could not create Android emulator: Failed to run AVD creation command
> Terminating xvnc.
> Xvnc Free Edition 4.1.2
> Copyright (C) 2002-2005 RealVNC Ltd.
> See http://www.realvnc.com for information on VNC.
> Underlying X server release 10300000, The X.Org Foundation
> Sun May 8 09:49:00 2011
> vncext: VNC extension running!
> vncext: Listening for VNC connections on port 5958
> vncext: created VNC server for screen 0
> Finished: NOT_BUILT
> I tracked down where this is failing in the code to https://github.com/jenkinsci/android-emulator-plugin/blob/master/src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java#L463 . We also ran "android create avd -c 32M -s 320x480 -n hudson_en-US_160_HVGA_android-4 -t 2" from the command line and it works fine (prompted for a create custom hardware profile though). Unfortunately, this was not enough information to figure out what is wrong. A corollary to this problem is that the android emulator plugin should have the option to run android creation commands with the -v (verbosity) turned on as described by http://developer.android.com/guide/developing/tools/android.html.
> To recap, I think this "failed to run AVD creation command" is a bug with how Android Emulator Plugin uses the creation command. I also felt logging the -v option would have been tremendously helpful for troubleshooting. I can log this portion as a separate enhancement if need be.
> Thanks and please let me know if I can provide any more information.

--
This message is automatically generated by JIRA.

If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa

chris@orr.me.uk (JIRA)

unread,
May 18, 2014, 6:26:05 PM5/18/14
to jenkinsc...@googlegroups.com
Christopher Orr closed Bug JENKINS-9623 as Incomplete

Marking old "resolved" issues as "closed".

Change By: Christopher Orr (18/May/14 10:26 PM)
Status: Resolved Closed
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
Reply all
Reply to author
Forward
0 new messages