SDK Location not found Android Studio + Gradle
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的更多相关文章
- Android studio gradle 打包 那些事
总结了一下 目前觉得比较好用的gradle 和一些打包 经验.放在这里. 首先说下 渠道号 这个概念,我们经常会统计我们的api 访问来源 是来自于那个app store,这有利于 我们针对性的推广. ...
- [转]加速Android Studio/Gradle构建
加速Android Studio/Gradle构建 android android studio gradle 已经使用Android Studio进行开发超过一年,随着项目的增大,依赖库的增多, ...
- 解决Android Studio Gradle Build Running慢的问题
Android Studio方便好用,但是Android Studio Gradle Build Running很慢 解决方法: C:\Users\你的用户名\.gradle 目录下新建一个文件名为 ...
- 解决Android Studio Gradle Build特别慢的问题
解决Android Studio Gradle Build 特别慢的问题 C:\Users\你的用户名\.gradle目录下新建一个文件名为gradle.properties的文件.内容为:org.g ...
- android studio gradle 两种更新方法更新
android studio gradle 两种更新方法更新 第一种.Android studio更新 第一步:在你所在项目文件夹下:你项目根目录gradlewrappergradle-wrapper ...
- android studio gradle 更新方法。
Android studio更新 第一步:在你所在项目文件夹下:你项目根目录gradlewrapper gradle-wrapper.properties (只要在打开项目的时候选OK,这个文件就 ...
- Android studio gradle配置完整版(转)
Android studio gradle配置完整版https://my.oschina.net/u/1471093/blog/539075 Android studio 自定义打包apk名 - pe ...
- Android Studio gradle编译 NullPointerException(no error message)解决
原文:Android Studio gradle编译 NullPointerException(no error message)解决 1.关闭Android Studio 2.找到工程目录下的 . ...
- [Android] Android studio gradle 插件的版本号和 gradle 的版本号 的对应关系
[Android] Android studio gradle 插件的版本号和 gradle 的版本号 的对应关系 本博客地址: wukong1688 本文原文地址:https://www.cnblo ...
随机推荐
- jenkins 启动slave,出现com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://127.0.0.1:8080/jnlpJars/remoting.jar
master: linux slave: win7 64位系统 在配置好系统后,采用jnlp的方式启动slave节点,报错如下: com.sun.deploy.net.FailedDownloadEx ...
- Windbg在软件调试中的应用
Windbg在软件调试中的应用 Windbg是微软提供的一款免费的,专门针对Windows应用程序的调试工具.借助于Windbg, 我们常见的软件问题:软件异常,死锁,内存泄漏等,就可以进行高效的排查 ...
- 关于Android中Animation的停止【转载】
转载自:http://blog.csdn.net/easonx1990/article/details/8231520 最近遇到一个需求,通过在GridView上改变焦点,并且GridView上每个i ...
- 02python程序和用户交互
在写程序时,使用python的内置函数来获取用户输入的值. >>> name = input("Input your name:")Input your name ...
- 【安全开发】python安全编码规范
申明:本文非笔者原创,原文转载自:https://github.com/SecurityPaper/SecurityPaper-web/blob/master/_posts/2.SDL%E8%A7%8 ...
- SpringBoot(九)-- SpringBoot JDBC
1.属性配置文件(application.properties) # type 可以修改连接池类型,默认采用Tomcat的连接池 # spring.datasource.type=com.alibab ...
- 安装.NET Framework 3.5
https://www.microsoft.com/zh-CN/download/details.aspx?id=22 https://docs.microsoft.com/zh-cn/dotnet/ ...
- javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
一: 在app的build中android { ... defaultConfig { ... //添加如下配置就OK了 javaCompileO ...
- STL——heap结构及算法
heap(隐式表述,implicit representation) 1. heap概述 : vector + heap算法 heap并不归属于STL容器组件,它是个幕后英雄,扮演priority q ...
- 深入浅出MFC——消息映射与命令传递(六)
1. 消息分类: 2. 万流归宗——Command Target(CCmdTarget): 3. "消息映射"是MFC内建的一个信息分派机制.通过三个宏(DECLARE_MESSA ...