Android Studio Error: “You must install the Androi

2019-01-14 17:44发布

I just initialised a project on Android Studio, and it was working fine in version 0.2.6, but in 0.2.7, I get this error:

enter image description here

It creates a folder inside my Applications directory, but it does not initialize the project. Any help regarding this problem would be appreciated. I get no problems with version 0.1.1 through version 0.2.6, but when it comes to 0.2.7, things start to get problematic, like this and I can't even start a project.

9条回答
该账号已被封号
2楼-- · 2019-01-14 18:28

Just a few ideas to try that should hopefully help. These can be found by using Ctrl + Shift + A.

"Sync project with Gradle" - (it's also often in the toolbar with a green and yellow ball and a blue down arrow next to three android icons)

"Gradle" and select the ToolBox option; then hit the blue refresh icon to refresh all the gradle projects

"Project Structure..." (also available under File) Under the Libraries project settings you should see a valid reference to your support library. You'll also want to skim through everything to make sure everything else looks good with the project.

"Invalidate Caches..." (another available under File) Invalidate and restart. This one got me going again after the previous upgrade generated a bunch of errors.

Some of these may be redundant, but after having fought with similar issues in the past it's just a few easy things I've found to check.

If refreshing everything doesn't work you can always pull up the Android SDK from Tools -> Android -> SDK or from the toolbar with the blue/green boxy android that has a black down arrow. It should be next to the Sync Gradle button.

查看更多
该账号已被封号
3楼-- · 2019-01-14 18:30

I update the Android Studio(AS) and see the same issue.

However, there is something slightly different about what I find out.

I actually have two sdks because I shift from Eclipse to AS.

Hence, I get one sdk in

c:\Program Files(x86)\Android\android-sdk

and anther in

c:\Android\android-studio\sdk.

And the real one that I use is in c:\Program Files(x86)\Android\android-sdk.

The important thing is that, I find that only one of the sdk setting is changed after the update.

Quick Start > Configure > Project Defaults > Project Structure

> Platform Settings > SDKs


1.7
        JDK home path:

        C:\Program Files\Java\jdk1.7.0_10

Android 2.2 Platform

        Android SDK home path:

        C:\Program Files(x86)\Android\android-sdk

Android 4.0.3 Platform

        same as 2.2

Android 4.2.2 Platform

        Android SDK home path:

        C:\Android\android-studio\sdk    <- it is modified after update!!!!

Android 4.3 Platform

        same as 2.2

After fixing the path in 4.2.2, I could create new project successfully again.

查看更多
Evening l夕情丶
4楼-- · 2019-01-14 18:33

I did a fresh install of Java, SDK and Android Studio, update it to 0.2.7 and install the ASR through SDK Manager, but the messages comes again.

So i found this solution.

The most common problem for Android Studio and 64Bit Windows System is the no 8.3 short path for C:\Program Files and C:\Program Files (x86).

find_java.exe

couldn't handle it and give a wrong path back.

Finally do this:

dir /x C: 

-- It shows no 8.3 short paths.

 fsutil 8dot3name query C:

-- It shows NtfsDisable8dot3NameCreation is 1 on "C:", means 8.3 short path won't be created in "C:".

Then I enable the generation of 8.3 short name by:

fsutil 8dot3name set C: 0

and create short names for C:\Program Files and C:\Program Files (x86) in windows recovery mode by:

fsutil file setshortname "C:\Program Files" PROGRA~1

fsutil file setshortname "C:\Program Files (x86)" PROGRA~2

And now dir /x C: can show the short names.

And now find_java.exe -s

can show the short path C:\PROGRA~1\Java\JDK17~1.0_2\bin\java.exe.

And now find_java.bat and android.bat can work good now!

source

Also copying SDK Manager.exe from android-studio\sdk\tools\lib to android-studio\sdk\

查看更多
登录 后发表回答