Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Failed to find an AVD compatible with target 'Android 1.6' error

I'm trying to run a Hello World app for Android for the first time, but I keep getting a:

Failed to find an AVD compatible with target 'Android 1.6'

error when I try to create an AVD.

I have tried the following solution in order to fix the issue:

  • Checked that I have the right packages installed. I have Android SDK Tools Revision 11, Android SDK Platform-Tools Revision 4, SDK Platforms 4, 7, 8, 9, 10, 11 and 12, Android Compatability package.
  • I've checked that my PATH environment variable is pointing to the right places for the Tools and the Platform-Tools folders.
  • Played around with setting the project at different platform levels etc.
  • Switching off my Virus Protection temporarily

I always get a similar error message, though.

This is what I get in the eclipse console when I try to launch.

[2011-05-28 11:43:47 - HelloAndroid] ------------------------------
[2011-05-28 11:43:47 - HelloAndroid] Android Launch!
[2011-05-28 11:43:47 - HelloAndroid] adb is running normally.
[2011-05-28 11:43:47 - HelloAndroid] Performing com.androidbook.hello.HelloActivity activity launch
[2011-05-28 11:43:47 - HelloAndroid] Failed to find an AVD compatible with target 'Android 1.6'.
[2011-05-28 11:44:27 - SDK Manager] could not create file 'C:\Windows\system32\config\systemprofile\.android\avd\Gingerbread.avd\sdcard.img', aborting...
[2011-05-28 11:44:27 - SDK Manager] could not write to 'C:\Windows\system32\config\systemprofile\.android\avd\Gingerbread.avd\sdcard.img', aborting...
[2011-05-28 11:44:27 - SDK Manager] Failed to create the SD card.
[2011-05-28 11:45:09 - HelloAndroid] Still no compatible AVDs with target 'Android 1.6': Aborting launch.
[2011-05-28 11:45:09 - HelloAndroid] Performing com.androidbook.hello.HelloActivity activity launch
[2011-05-28 11:45:11 - HelloAndroid] Launch canceled!

I notice that my packages are installed at:

C:\Program Files\Android\android-sdk

because thats what is says at the top of the Android SDK and AVD manager when the Installed Packages option is selected. But when I choose the Virtual Devices option, the location it is looking for the virtual devices in:

C:\Windows\system32\config\systemprofile\.android\avd. 

In the book that I'm following there is a screenshot of his SDK and AVD Manager looking for the virtual devices in a

C:\Documents and Setting\Dave\.android\avd

folder. Will it make any difference to me if I change where the Manager looks for this stuff? Can anyone tell me how I can do that?

Grateful for any help on this. I just want to get cracking!

Many thanks

like image 655
Joe Avatar asked May 28 '11 11:05

Joe


1 Answers

In this end I solved in by the following method:

I set a new environment variable ANDROID_SDK_HOME to the same location as my HOME environment variable which is C:\Users\MyName (This was suggested by one of the commenters in this article)

This changed the location that the Android SDK and AVD manager was looking for virtual devices in. When I added a new device then, I didn't seem to get any problem (Actually as I did this in the process of launching my app, I actually had to close everything down and relaunch so it could find the AVD that I had just created).

I'm amazed at how long the AVD actually takes to fully fire-up and install my 10 line app. It literally took about 5 minutes so I could see "Hello World".

Still... victory is mine!

like image 81
Joe Avatar answered Nov 03 '22 02:11

Joe