开发者

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 Manag开发者_如何学运维er] 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


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!


This can happen when:

  • You have multiple copies of the Android SDK installed on your machine. You're updating the available images and devices for one SDK, and trying to debug or run your app in another. If using Eclipse, take a look at your "Preferences | Android | SDK Location". Make sure it's the path you expect. If not, change the path to point to where you think the Android SDK is installed.

  • You don't have an Android device setup in your emulator as detailed in other answers on this page.


the only thing that i did was create a new environment variable ANDROID_SDK_HOME = C:\Users\username and then restart my computer, at the end I open my eclipse again and the error dissapear.


One of the reasons may be that you haven't actually created an AVD to work with.
For that, click the Android Virtual Device Manager (also AVD Manager) from the Windows tab in your Eclipse IDE.
In your AVD Manager window, you see two tabs; 1st one containing the existing AVDs to work with, and the 2nd tab contains Device Definitions.
So you basically have to create your own AVDs available in the Device Definitions and make them available in the first tab, so that they in turn are available for you to use!...
Hope this helps.
Apart from this, there could be yet another issue relating to the RAM of the AVD that we assign. Do read the alert at the bottom of the Create New AVD window which says 'use lesser RAM as higher RAMs more that 768MB may fail to load on Windows'..
And yeah, you've got to be patient with the loading of AVD. Keep an eye on the console of eclipse.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜