Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-38237

Invalid AVD Path / AVD not created

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Incomplete
    • Labels:
      None
    • Environment:
      Jenkins 2.1
      Android SDK is configured on slave agent, Ubuntu Server LTS 14.04
    • Similar Issues:

      Description

      11:46:06 $ /home/jenkins/android/tools/android list target
      11:46:07 [android] Using Android SDK: /home/jenkins/android
      11:46:07 [android] Creating Android AVD: /tmp/.android/avd/hudson_pl-PL_320_768x1280_Google_Inc._Google_APIs_17_armeabi-v7a_-jars-test.avd
      11:46:07 [android] /home/jenkins/android/tools/android create avd -f -a -c 64M -s 768x1280 -n hudson_pl-PL_320_768x1280_Google_Inc._Google_APIs_17_armeabi-v7a_-jars-test -t "Google Inc.:Google APIs:17" --abi armeabi-v7a
      11:46:08 [android] Could not create Android emulator: Failed to parse AVD config file
      

      I checked source code of plugin, and the only place where '/tmp' directory is being set is at
      https://github.com/jenkinsci/android-emulator-plugin/blob/master/src/main/java/hudson/plugins/android_emulator/util/Utils.java#L284

      I investigated this further by creating simple jar, which was then ran in 'execute shell' build step..

      public class Main {
          public static void main(String[] args) {
              System.out.println("home: " + System.getenv("HOME"));
              System.out.println("username: " + System.getProperty("user.name"));
          }
      }
      

      and here is the output:

      12:39:13 home: null
      12:39:13 username: jenkins
      

      When I execute this jar directly from shell over ssh it works properly.

      I have no clue why is it working that way, but have you considered using EnvVars class? It stores all environment variables available on machine, including those injected by plugins / slaves.
      http://javadoc.jenkins-ci.org/hudson/EnvVars.html

        Attachments

          Activity

          adamkobusifm Adam Kobus created issue -
          adamkobusifm Adam Kobus made changes -
          Field Original Value New Value
          Summary Invalid AVD Path in build logs Invalid AVD Path / AVD not created
          adamkobusifm Adam Kobus made changes -
          Description
          {noformat}
          11:46:06 $ /home/jenkins/android/tools/android list target
          11:46:07 [android] Using Android SDK: /home/jenkins/android
          11:46:07 [android] Creating Android AVD: /tmp/.android/avd/hudson_pl-PL_320_768x1280_Google_Inc._Google_APIs_17_armeabi-v7a_-jars-test.avd
          11:46:07 [android] /home/jenkins/android/tools/android create avd -f -a -c 64M -s 768x1280 -n hudson_pl-PL_320_768x1280_Google_Inc._Google_APIs_17_armeabi-v7a_-jars-test -t "Google Inc.:Google APIs:17" --abi armeabi-v7a
          11:46:08 [android] Could not create Android emulator: Failed to parse AVD config file
          {noformat}

          I checked source code of plugin, and the only place where '/tmp' directory is being set is at
          https://github.com/jenkinsci/android-emulator-plugin/blob/master/src/main/java/hudson/plugins/android_emulator/util/Utils.java#L284

          I investigated this further by creating simple jar which executed following code:

          {code:java}
          public class Main {
              public static void main(String[] args) {
                  System.out.println("home: " + System.getenv("HOME"));
                  System.out.println("username: " + System.getProperty("user.name"));
              }
          }
          {code}

          and here is the output:

          {noformat}
          12:39:13 home: null
          12:39:13 username: jenkins
          {noformat}

          I have no clue why is it working that way, but have you considered using EnvVars class? It stores all environment variables available on machine, including those injected by plugins / slaves.
          http://javadoc.jenkins-ci.org/hudson/EnvVars.html

          {noformat}
          11:46:06 $ /home/jenkins/android/tools/android list target
          11:46:07 [android] Using Android SDK: /home/jenkins/android
          11:46:07 [android] Creating Android AVD: /tmp/.android/avd/hudson_pl-PL_320_768x1280_Google_Inc._Google_APIs_17_armeabi-v7a_-jars-test.avd
          11:46:07 [android] /home/jenkins/android/tools/android create avd -f -a -c 64M -s 768x1280 -n hudson_pl-PL_320_768x1280_Google_Inc._Google_APIs_17_armeabi-v7a_-jars-test -t "Google Inc.:Google APIs:17" --abi armeabi-v7a
          11:46:08 [android] Could not create Android emulator: Failed to parse AVD config file
          {noformat}

          I checked source code of plugin, and the only place where '/tmp' directory is being set is at
          https://github.com/jenkinsci/android-emulator-plugin/blob/master/src/main/java/hudson/plugins/android_emulator/util/Utils.java#L284

          I investigated this further by creating simple jar, which was then ran in 'execute shell' build step..

          {code:java}
          public class Main {
              public static void main(String[] args) {
                  System.out.println("home: " + System.getenv("HOME"));
                  System.out.println("username: " + System.getProperty("user.name"));
              }
          }
          {code}

          and here is the output:

          {noformat}
          12:39:13 home: null
          12:39:13 username: jenkins
          {noformat}

          When I execute this jar directly from shell over shh it works properly.

          I have no clue why is it working that way, but have you considered using EnvVars class? It stores all environment variables available on machine, including those injected by plugins / slaves.
          http://javadoc.jenkins-ci.org/hudson/EnvVars.html

          adamkobusifm Adam Kobus made changes -
          Description {noformat}
          11:46:06 $ /home/jenkins/android/tools/android list target
          11:46:07 [android] Using Android SDK: /home/jenkins/android
          11:46:07 [android] Creating Android AVD: /tmp/.android/avd/hudson_pl-PL_320_768x1280_Google_Inc._Google_APIs_17_armeabi-v7a_-jars-test.avd
          11:46:07 [android] /home/jenkins/android/tools/android create avd -f -a -c 64M -s 768x1280 -n hudson_pl-PL_320_768x1280_Google_Inc._Google_APIs_17_armeabi-v7a_-jars-test -t "Google Inc.:Google APIs:17" --abi armeabi-v7a
          11:46:08 [android] Could not create Android emulator: Failed to parse AVD config file
          {noformat}

          I checked source code of plugin, and the only place where '/tmp' directory is being set is at
          https://github.com/jenkinsci/android-emulator-plugin/blob/master/src/main/java/hudson/plugins/android_emulator/util/Utils.java#L284

          I investigated this further by creating simple jar, which was then ran in 'execute shell' build step..

          {code:java}
          public class Main {
              public static void main(String[] args) {
                  System.out.println("home: " + System.getenv("HOME"));
                  System.out.println("username: " + System.getProperty("user.name"));
              }
          }
          {code}

          and here is the output:

          {noformat}
          12:39:13 home: null
          12:39:13 username: jenkins
          {noformat}

          When I execute this jar directly from shell over shh it works properly.

          I have no clue why is it working that way, but have you considered using EnvVars class? It stores all environment variables available on machine, including those injected by plugins / slaves.
          http://javadoc.jenkins-ci.org/hudson/EnvVars.html

          {noformat}
          11:46:06 $ /home/jenkins/android/tools/android list target
          11:46:07 [android] Using Android SDK: /home/jenkins/android
          11:46:07 [android] Creating Android AVD: /tmp/.android/avd/hudson_pl-PL_320_768x1280_Google_Inc._Google_APIs_17_armeabi-v7a_-jars-test.avd
          11:46:07 [android] /home/jenkins/android/tools/android create avd -f -a -c 64M -s 768x1280 -n hudson_pl-PL_320_768x1280_Google_Inc._Google_APIs_17_armeabi-v7a_-jars-test -t "Google Inc.:Google APIs:17" --abi armeabi-v7a
          11:46:08 [android] Could not create Android emulator: Failed to parse AVD config file
          {noformat}

          I checked source code of plugin, and the only place where '/tmp' directory is being set is at
          https://github.com/jenkinsci/android-emulator-plugin/blob/master/src/main/java/hudson/plugins/android_emulator/util/Utils.java#L284

          I investigated this further by creating simple jar, which was then ran in 'execute shell' build step..

          {code:java}
          public class Main {
              public static void main(String[] args) {
                  System.out.println("home: " + System.getenv("HOME"));
                  System.out.println("username: " + System.getProperty("user.name"));
              }
          }
          {code}

          and here is the output:

          {noformat}
          12:39:13 home: null
          12:39:13 username: jenkins
          {noformat}

          When I execute this jar directly from shell over ssh it works properly.

          I have no clue why is it working that way, but have you considered using EnvVars class? It stores all environment variables available on machine, including those injected by plugins / slaves.
          http://javadoc.jenkins-ci.org/hudson/EnvVars.html

          sebokopter Sebastian Heil made changes -
          Priority Minor [ 4 ] Major [ 3 ]
          orrc Christopher Orr made changes -
          Resolution Incomplete [ 4 ]
          Status Open [ 1 ] Closed [ 6 ]

            People

            Assignee:
            orrc Christopher Orr
            Reporter:
            adamkobusifm Adam Kobus
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: