Gradle: SDK location not found, 问题与解决
来源:互联网 发布:ubuntu exe安装包 编辑:程序博客网 时间:2024/06/08 07:38
原文链接
https://xinyustudio.wordpress.com/2014/07/02/gradle-sdk-location-not-found-the-problem-and-solution/
我是在cocos3.10新建项目无法用android studio打开时遇到的。
原文中写的非常清楚和详细。非常感谢原作者!
In a recent project, I created a Gradle project in windows, but when I load the project in Ubuntu and Mac OSX, an error “SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable”
问题图片
I then followed the instruction, and in the ~/.bashrc file, I added the environment variable ANDROID_HOME
我然后修改了 ~/.bashrc file来添加环境变量
(我是在终端中输入 open .bash_profile 后在里面加入了 export ANDROID_HOME=/user...你的sdk地址
And then I sourced this file in the terminal:
source ~/.bashrc
When rebuilding the gradle model, the same problem persists!
To troubleshoot this, I then followed the instruction as shown in the first snapshot:
- Create a new file called local.properties in the root folder of the gradle project
Before adding local.properties After adding local.properties
- Edit the newly created local.properties file, add the single line as following:
- 在新项目中新建一个 local.properties 文件,在里面添加一行代码
sdk.dir=/home/user/Android/adt/sdk
where “/home/user/Android/adt/sdk” is the path where installed the Android SDK.
/home/user/Android/adt/sdk是你的sdk路径
- Rebuild the model, now it works!
This approach is also applicable to Mac OSX!
Happy coding!
大功告成- Gradle: SDK location not found, 问题与解决
- SDK location not found
- SDK location not found.Denfine location with sdk.dir。。。。
- Gradle DSL method not found: 'runProguard()' 问题的引发与解决
- Android:解决Gradle DSL method not found: 'runProguard()' 问题
- Android:解决Gradle DSL method not found: 'runProguard()' 问题
- AndroidStudio:解决Gradle DSL method not found: 'runProguard()' 的问题
- Android:解决Gradle DSL method not found: 'runProguard()' 问题
- 解决gradle DSL method not found: android()问题
- 解决Android Studio Gradle DSL method not found: 'android()'问题
- Android:解决Gradle DSL method not found: 'runProguard()' 问题
- Android:解决Gradle DSL method not found: 'runProguard()' 问题
- 解决Android Studio Gradle DSL method not found: 'android()'问题
- SDK location not found. Define location with...的解决方法
- Android Studio 导入项目时遇到sdk location not found错误,如何解决
- Android Studio 导入项目时遇到sdk location not found错误,如何解决
- 解决gradle DSL method not found: android()
- 解决Gradle DSL method not found: ‘android()’
- 51nod1083矩阵取数问题
- NSURLSession的用法详解和设计原理
- volatile
- 加密解密的一些认识
- 创建离散任务时MRP净值的含义
- Gradle: SDK location not found, 问题与解决
- LeetCode 100. Same Tree C语言
- zoj-3767-Elevator
- springmvc中的controller中的几种参数绑定
- 2013腾讯编程马拉松初赛第〇场(3月20日)(HDU 4500 4501 4502 4503 4504)
- C和OC 字符串
- Java static的简要概括
- PHP中POST、GET和REQUEST
- 20160424