extends: http://stackoverflow.com/questions/19272127/sdk-location-not-found-android-studio-gradle

I had very similar situation (had a project on another machine and cloned it to my laptop and saw the same issue) and I looked in it.

Error message was coming from Sdk.groovy of Android gradle plugin: https://android.googlesource.com/platform/tools/build/+/master/gradle/src/main/groovy/com/android/build/gradle/internal/Sdk.groovy

By looking at code, its findLocation needs to set androidSdkDir variable and there are only three ways to do it:

create local.properties file and have either sdk.dir or android.dir line.
have ANDROID_HOME environment variable defined.
System.getProperty("android.home") - I'm not sure how it works, but it seems like a Java thing.
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.

I created local.properties file at the project root and put the following line and it compiled the code successfully.

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

SDK Location not found Android Studio + Gradle的更多相关文章

  1. Android studio gradle 打包 那些事

    总结了一下 目前觉得比较好用的gradle 和一些打包 经验.放在这里. 首先说下 渠道号 这个概念,我们经常会统计我们的api 访问来源 是来自于那个app store,这有利于 我们针对性的推广. ...

  2. [转]加速Android Studio/Gradle构建

    加速Android Studio/Gradle构建 android android studio gradle   已经使用Android Studio进行开发超过一年,随着项目的增大,依赖库的增多, ...

  3. 解决Android Studio Gradle Build Running慢的问题

    Android Studio方便好用,但是Android Studio Gradle Build Running很慢 解决方法: C:\Users\你的用户名\.gradle 目录下新建一个文件名为 ...

  4. 解决Android Studio Gradle Build特别慢的问题

    解决Android Studio Gradle Build 特别慢的问题 C:\Users\你的用户名\.gradle目录下新建一个文件名为gradle.properties的文件.内容为:org.g ...

  5. android studio gradle 两种更新方法更新

    android studio gradle 两种更新方法更新 第一种.Android studio更新 第一步:在你所在项目文件夹下:你项目根目录gradlewrappergradle-wrapper ...

  6. android studio gradle 更新方法。

    Android studio更新 第一步:在你所在项目文件夹下:你项目根目录gradlewrapper gradle-wrapper.properties   (只要在打开项目的时候选OK,这个文件就 ...

  7. Android studio gradle配置完整版(转)

    Android studio gradle配置完整版https://my.oschina.net/u/1471093/blog/539075 Android studio 自定义打包apk名 - pe ...

  8. Android Studio gradle编译 NullPointerException(no error message)解决

    原文:Android Studio gradle编译 NullPointerException(no error message)解决 1.关闭Android Studio  2.找到工程目录下的 . ...

  9. [Android] Android studio gradle 插件的版本号和 gradle 的版本号 的对应关系

    [Android] Android studio gradle 插件的版本号和 gradle 的版本号 的对应关系 本博客地址: wukong1688 本文原文地址:https://www.cnblo ...

随机推荐

  1. UGUI表情系统解决方案

    参考链接: https://blog.uwa4d.com/archives/Sparkle_UGUI.html http://tech.seasungame.com/blog/index.php/20 ...

  2. jQuery easyUI的datagrid,如何在翻页以后仍能记录被选中的行

    1.先给出问题解决后的代码 <%@ page language="java" import="java.util.*" pageEncoding=&quo ...

  3. mysql中floor函数的作用是什么?

    需求描述: 最近写mysql程序的时候,使用了floor函数,在此记录下该函数的作用 操作过程: 1.使用floor函数的测试 mysql> select floor(1.23),floor(- ...

  4. Pair programming

    Pair programming is an agile software development technique in which two programmers work together a ...

  5. eclipse 搜索 正则表达式

    1.换行搜索,如下: \.dyform\([\r]*[\s]*\{

  6. go反射的规则

    第一次知道反射的时候还是许多年前在学校里玩 C# 的时候.那时总是弄不清楚这个复杂的玩意能有什么实际用途……然后发现 Java 有这个,后来发现 PHP 也有了,再后来 Objective-C.Pyt ...

  7. SpringMVC由浅入深day01_12.4 pojo绑定_12.5自定义参数绑定实现日期类型绑定_12.6集合类

    12.4 pojo绑定 页面中input的name和controller的pojo形参中的属性名称一致,将页面中数据绑定到pojo. 页面定义: controller的pojo形参的定义: 打断点测试 ...

  8. 6.824 Lab 5: Caching Extents

    Introduction In this lab you will modify YFS to cache extents, reducing the load on the extent serve ...

  9. 【Android】录音暂停和继续

    https://www.2cto.com/kf/201410/347839.html http://blog.csdn.net/wanli_smile/article/details/7715030 ...

  10. 【web端权限维持】利用ADS隐藏webshell

    0X01 前言 未知攻,焉知防,在web端如何做手脚维护自己拿到的权限呢?首先要面临的是webshell查杀,那么通过利用ADS隐藏webshell,不失为一个好办法. 0X02 利用ADS隐藏web ...