Android SDK and AVD Manager will not run

前端 未结 13 1257
被撕碎了的回忆
被撕碎了的回忆 2020-12-10 04:37

I installed the Android SDK but I cannot use it because the AVD and SDK Managers do not run. When I try to open either one of them, a command prompt window pops up for about

相关标签:
13条回答
  • 2020-12-10 05:07

    Dont delete the .android folder. Juz delete the avd folder within the .android folder. It shld do a lot of good to your work.

    Advance cheers. Prakash.

    0 讨论(0)
  • 2020-12-10 05:07

    I faced the same problem on Windows 8.1, and it is solved by running Android Studio as Administrator

    0 讨论(0)
  • 2020-12-10 05:12

    I found the same problem that Rajesh found from his comment above. The command in parentheses on this line was not executing

    for /f "delims=" %%a in ('"%java_exe%" -jar lib\archquery.jar') do set swt_path=lib\%%a
    

    Edit: some people may have this line: for /f "delims=" %%a in ('"%~dps0find_java%arch_ext%.exe" -s') do set java_exe=%%a

    This line is from find_java.bat in the tools\lib\ directory of the sdk.

    I have a Win 7 x64 system and I'm not about to reload the entire OS so I hardcoded what MZB suggested from his post above:

    After this line:

    for /f "delims=" %%a in ('"%java_exe%" -jar lib\archquery.jar') do set swt_path=lib\%%a
    

    edit: or this line:

    for /f "delims=" %%a in ('"%~dps0find_java%arch_ext%.exe" -s') do set java_exe=%%a

    I added this line:

    set java_exe=%JAVA_HOME%\bin\java.exe
    

    This assumes you have the JAVA_HOME environment variable set to the Java JDK folder (without \bin)

    If your JAVA_HOME variable includes the \bin then set it like this:

    set java_exe=%JAVA_HOME%\java.exe
    

    If you don't have the JAVA_HOME environment set, then you need to hard code it with the actual path you have on your machine as MZB did in his post.

    I also did it for the javaw logic too:

    set javaw_exe=%JAVA_HOME%\bin\javaw.exe
    

    I can finally access the SDK Manager.


    UPDATE 06/01/2015:

    To Ken Y-N who updated this post after I submitted it:

    When I created this post, I had referenced this line:

    for /f "delims=" %%a in ('"%~dps0find_java%arch_ext%.exe" -s') do set java_exe=%%a

    This in in my current find_java.bat from folder ...\sdk\tools\lib which I just updated yesterday from the current version of Android Studio Windows x64 version (android-studio-bundle-141.1903250-windows.exe). the variable %arch_ext% will either have 32 or 64 in it depending on what system they have.

    But I don't know how the above line got converted to:

    for /f "delims=" %%a in ('"%java_exe%" -jar lib\archquery.jar') do set swt_path=lib\%%a

    after Ken Y-N did the edit.

    But perhaps some people have your version in their find_java.bat file but I would believe some people have the other like I do. I'm just pointing this out for those that are having a problem not being able to open their SDK Manager.

    Plus I should mention I had this problem with both JDK1.7 and JDK1.8. I had originally installed JDK1.8 but when reading the requirements for Android Studio yesterday, it said JDK1.7 was required, so I installed JDK1.7 last night thinking that would solve my problem, but the problem with find_java.bat was the same with either version of JDK.

    I should point out too, when I installed Android Studio with both versions of the JDK, I was originally able to access the SDK Manager before opening up Android Studio for the first time. But when I opened up Android Studio, it started updating the SDK Manager first and maybe that's when the problem occurs because after starting up an IDEA project, I could not open up the SDK Manager after that.

    So maybe find_java.bat has this line BEFORE opening up Android Studio for the first time:

    for /f "delims=" %%a in ('"%java_exe%" -jar lib\archquery.jar') do set swt_path=lib\%%a

    And when Adroid Studio updates the SDK, it the has this line?

    for /f "delims=" %%a in ('"%~dps0find_java%arch_ext%.exe" -s') do set java_exe=%%a

    I don't have time to test that out - I already lost so much time trying to figure out how to access the SDK. Maybe someone else can confirm this if they're having the same problem.

    0 讨论(0)
  • 2020-12-10 05:14

    I had the same issue on my windows-8 64 bit machine. Narrowed the problem down to a particular statement for /f "delims=" %%a in ('"%~dps0\find_java.exe" -s') do set java_exe=%%a in the find_java.bat file.

    For some reason the statement in the parentheses was not being executed as a command. I tried out all the suggested solutions above but none of them worked. In the end found that this particular statement worked fine on another Windows 8 64 bit machine so there was some problem with my Windows 8 installation. I checked my OS system files and found some of them were corrupt, so I did a repair of my Windows 8 installation and after that everything worked fine.

    0 讨论(0)
  • 2020-12-10 05:16

    I installed a new x64 version of the JDK and that fixed my issue

    0 讨论(0)
  • 2020-12-10 05:16

    I had this problem with a fresh install of 64 bit win 7 pro, using and a fresh install of the 64 bit JDK.

    Kenton Price's solution in this post fixed me up, and now it all works perfectly.

    Android SDK installation doesn't find JDK

    for some reason the (originally linux developed) ADK on my system needed JAVA_HOME defined with linux style forward slashes instead of windows style backslashes.

    0 讨论(0)
提交回复
热议问题