Android SDK and AVD Manager -Cant create AVD in correct file location

前端 未结 5 2117
一生所求
一生所求 2020-12-09 06:02

When trying to create an AVD with the android SDK AVD manager I get \'Error: null\'. This keeps happening because the SDK manager is looking for \'List of existing Android V

5条回答
  •  春和景丽
    2020-12-09 06:45

    I had the same problem this weekend. In my case, I was able to create the AVD's, but not able to start them.

    The problem was caused by the AVD Manager creating the AVD's in a different directory from where the emulator was trying to launch the AVD's.

    In my case, AVD Manager was initially reporting the list of existing Android Virtual Device located at C:\Users\toybuilder\Downloads\.android\avd

    It turns out that my Java runtime (in this case, JDK 1.6u24) was reporting C:\Users\toybuilder\Downloads as my home directory (user.home property). I first confirmed this via Eclipse:

    In Eclipse, go to:

    Eclipse Menu: Help -> About Eclipse Click on the [Installation Details] Click on the [Configuration] tab: The text box fills with an extended dump of the Eclipse environment . Look for the user.home value. In my case, the line read: user.home=C:\Users\toybuilder\Downloads

    It turns out that there's a long-standing Java bug (nearly 9 years old) on how the Java runtime determine's the user.home property - as discussed elsewhere on StackOverflow

    In my particular case, the buggy behavior was triggered by a bad windows folders redirection. I had apparently moved my Desktop folder into my Downloads directory at some point by accident. Although I had fixed the problem, it nevertheless left an entry in my registry with a Desktop folder redirection to the Downloads directory. There was a HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Desktop registry key that pointed, incorrectly, to C:\Users\toybuilder\Downloads\Desktop

    The Java runtime was apparently setting user.home as "Desktop"/.. (i.e., the Downloads directory), while some other mechanisms were resolving the home directory at the correct location (probably the Windows %userprofile% environmental value) -- and hence when the emulator was starting up, it could not find the .android/avd directory, because it was looking from a different starting directory.

    After I deleted the incorrect redirection registry key, the problem went away.

提交回复
热议问题