SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
问题描述:
已经安装了android-sdk 和gradle环境,并配置了环境变量,如下所示:
android环境
root@wangju-HP--G4:/home/wangju/Desktop/5i5j_android/AppFrameWork# adb version
Android Debug Bridge version 1.0.
Version 29.0.-
Installed as /usr/local/android-home/android-sdk-linux/platform-tools/adb
gradle环境:
root@wangju-HP--G4:/home/wangju/Desktop/5i5j_android/AppFrameWork# gradle -version ------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------ Build time: -- :: UTC
Revision: 8fa6ce7945b640e6168488e4417f9bb96e4ab46c Groovy: 2.4.
Ant: Apache Ant(TM) version 1.9. compiled on February
JVM: 1.8.0_211 (Oracle Corporation 25.211-b12)
OS: Linux 4.15.--generic amd64
在android项目的app目录下执行gradle clean/tasks命令时会报如下错误:
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
> Must apply 'com.android.application' first! * Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org
解决办法:
根据错误提示
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
翻译过来的意思就是:没有找到sdk,可以在local.properties这个文件中定义android_home,即指明android sdk的所在位置
在app目录下新建local.properties文件,文件内容如下所示:
/usr/local/android-home/android-sdk-linux 是我android sdk的安装目录
sdk.dir=/usr/local/android-home/android-sdk-linux
配置好后,再用gradle clean即可
参考文档:
https://blog.csdn.net/cocos2dx_3_0/article/details/51235732
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.的更多相关文章
- mac android studio 出现 Error: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
Error: SDK location not found. Define location with sdk.dir in the local.properties file or with a ...
- Eclipse导入Gradle时报错:SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable
百度查到http://stackoverflow.com/questions/19794200/gradle-android-and-the-android-home-sdk-location 按照其 ...
- DK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME
根据提示,我们可以新建一个项目或者以前自己使用过没问题的工程,从中把local.properties文件copy到我们从github中想要导入的工程中,我自己就是这样的,然后这个问题就解决了. ndk ...
- SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID
如题: SDK location not found. Define location with sdk.dir in the local.properties file or with an AND ...
- 【已解决】mac上appium报错:“Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path”
按照网上教程配置完appium环境后,真机跑自动化过程,遇到如下报错: appium报错如下: [ADB] Checking whether aapt is present [ADB] The AND ...
- Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path
写case写好好哒,突然debug的时候就冒出这个错误: selenium.common.exceptions.WebDriverException: Message: An unknown serv ...
- Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path
背景:运行代码提示找不到ADB An unknown server-side error occurred while processing the command. Original error: ...
- window.top.location.href 和 window.location.href 的区别
"window.location.href"."location.href"是本页面跳转. "parent.location.href" 是 ...
- 关于js中"window.location.href"、"location.href"、"parent.location.href"、"top.location.href"的用法
location.href 和 window.location.href 区别: 1.location.href 可以直接跳转其他地址(不属于本项目) 也可以跳转本项目中的 2.window.loca ...
随机推荐
- SQL语句复习【专题六】
SQL语句复习[专题六] 用户 + 创建表 --创建一个新的用户,然后给新的用户创建一张表,然后给表中添加一些数据.查询表中的数据 --创建用户需要比较大的权限 DBA create user di ...
- 1.python环境安装
一:安装Python与环境配置 二:安装pip 三:Anaconda安装和使用 3.1 什么是 Anaconda? Anaconda是专注于数据分析的Python发行版本,支持 Linux, Mac, ...
- IDEA利用mybatis-generator自动生成dao和mapper
pom.xml配置 <properties> <java.version>1.8</java.version> <mybatis-generator-core ...
- PAT1005 继续(3n+1)猜想
卡拉兹(Callatz)猜想已经在1001中给出了描述.在这个题目里,情况稍微有些复杂. 当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数.例如对 n=3 进行验证的时 ...
- kotlin字符串和数字之间的转换和人机交互
继续基础学习~ 字符串和数字之间的转换 那如何转换呢,其实很简单: 编译木有报错,但是运行: 所以这里了解下. 人机交互 看这标题貌似高端的,其实也就是程序可以接受键盘的输入啦,下面开始: 首先提示用 ...
- error LNK2019 : unresolved external symbol Zbar配置问题
原文链接:https://blog.csdn.net/MengchiCMC/article/details/77871714 出现error LNK2019 : unresolved external ...
- 初识LVS和LVS_NAT
如果一台服务器承受过多的压力,那么服务可能会崩溃,所以,我们应该让一台服务器承受的压力在合理范围内,但是如果服务端必须要承受较大的压力,那么一台服务器可能无法满足我们的要求,所以我们可以使用多台服务器 ...
- Luogu P3804 【模板】后缀自动机
注意空间开两倍 #include <bits/stdc++.h> using namespace std; typedef long long LL; template<class ...
- js中for..of..和迭代器
for..of是ES6中引入的新特性,它主要的作用是:循环一个可迭代的对象. 它可以循环遍历,数组.字符串.Set对象等等 示例一: let str = 'hello' for (item of st ...
- PyQt打包可执行文件
1.安装pyinstaller pip install pyinstaller 2.pyinstaller打包 pyinstaller -F -w xxxx.py -F:生成可执行文件 -w:不显示命 ...