Emulator won't start when using android-20 API

XMLWordPrintable

    • Type: New Feature
    • Resolution: Duplicate
    • Priority: Minor
    • None
    • Environment:
      Jenkins ver. 1.592, android-emulator 2.12

      When using android-20 API as a target there is a error during creating AVD:
      [android] /home/builder/android-sdk/android-sdk/tools/android create avd -f -a -s 720x1280 -n hudson_pl-PL_300_720x1280_android-20 -t android-20 --abi armeabi-v7a
      [android] Failed to run AVD creation command
      Error: Invalid --tag default for the selected target.

      The solution to this problem is here http://stackoverflow.com/a/25598879/1204234 , but when the working --abi parameter is used eg. android-wear/armeabi-v7a then the name of the AVD become incorrect because there is a slash in it:
      [android] /home/builder/android-sdk/android-sdk/tools/android create avd -f -a -s 720x1280 -n hudson_pl-PL_300_720x1280_android-20_android-wear/armeabi-v7a -t android-20 --abi android-wear/armeabi-v7a
      [android] Failed to run AVD creation command
      Error: AVD name 'hudson_pl-PL_300_720x1280_android-20_android-wear/armeabi-v7a' contains invalid characters.
      Allowed characters are: a-z A-Z 0-9 . _ -

      When I modified method getGeneratedAvdName() in EmulatorConfig.java in the way shown below

      private String getGeneratedAvdName() {
      ..
      String abi = "";
      if (targetAbi != null && osVersion.requiresAbi())

      { //BEFORE //abi = "_" + targetAbi.replace(' ', '-').replace('_', '-'); //AFTER abi = "_" + targetAbi.replaceAll("[^a-zA-Z0-9._-]", "-"); }

      ...
      }

      Compiled plugin and replaced the original it is working

            Assignee:
            Christopher Orr
            Reporter:
            Adam Vorin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: