找不到错误的SDK位置 [英] Error SDK location not found

查看:91
本文介绍了找不到错误的SDK位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从gitHub克隆了该项目,以检查 segment.io 上的示例代码.导入android studio后,出现错误

I cloned the project from gitHub to check the sample code on segment.io. After importing into the android studio I am getting the error

错误:找不到SDK位置.在local.properties文件中使用sdk.dir或使用ANDROID_HOME环境变量来定义位置.

Error:SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

我将 local.properties 中的SDK位置更改为我当前的SDK位置

I changed the SDK location in local.properties to my current SDK location which is

sdk.dir = /home/mobiefit/Android/Sdk

但是我仍然遇到相同的错误.

But I am still getting the same error.

推荐答案

只有三种方法可以做到:

There are only three ways to do it:

创建 local.properties 文件,并具有 sdk.dir android.dir 行.定义了 ANDROID_HOME 环境变量.

create local.properties file and have either sdk.dir or android.dir line. have ANDROID_HOME environment variable defined.

虽然您的Android Studio知道SDK就在那个地方,但我怀疑Android Studio是否会将这些信息传递给gradle,因此我们看到了该错误.

While your Android Studio knows that the SDK is at that place, I doubt that Android Studio is passing that information to gradle and thus we're seeing that error.

您需要在项目根目录下创建local.properties文件,并放入以下行,它应能成功编译代码.

You need to create local.properties file at the project root and put the following line and it should compile the code successfully.

ex sdk.dir =/Applications/Android Studio.app/sdk/

这篇关于找不到错误的SDK位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆