SDK Location not found Android Studio + Gradle

后端 未结 13 2293
北荒
北荒 2020-12-08 04:09

I have seen this same thing posted quite a few times, but whenever I try to import my project to my new work laptop I keep getting this error.

I have pulled the proj

13条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 04:32

    To fix this problem, I had to define the ANDROID_HOME environment variable in the Windows OS.

    To do this, I went to the System control panel.
    I selected "Advanced system settings" in the left column.
    On the "Advanced" tab, I selected "Environment Variables" at the bottom.

    Here, I did not have an ANDROID_HOME variable defined. For this case, I selected "New..." and:
    1) for "Variable name" I typed ANDROID_HOME,
    2) for "Variable value", I typed the path to my SDK folder, e.g. "C:\...\AppData\Local\Android\sdk".

    I then closed Android Studio and reopened, and everything worked.

    Thanks to Dibish (https://stackoverflow.com/users/2244411/dibish) for one of his posts that gave me this idea.

提交回复
热议问题