SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROI

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROI,第1张

概述问题描述:已经安装了android-sdk和gradle环境,并配置了环境变量,如下所示:android环境root@wangju-HP-348-G4:/home/wangju/Desktop/5i5j_android/AppFrameWork#adbversionAndroidDebugBridgeversion1.0.41Version29.0.5-5949299Installedas/usr/local/android-h

问题描述:

已经安装了androID-sdk 和gradle环境,并配置了环境变量,如下所示:

androID环境

root@wangju-HP-348-G4:/home/wangju/Desktop/5i5j_androID/AppFrameWork# adb versionAndroID DeBUG BrIDge version 1.0.41Version 29.0.5-5949299Installed as /usr/local/androID-home/androID-sdk-linux/platform-tools/adb

gradle环境:

root@wangju-HP-348-G4:/home/wangju/Desktop/5i5j_androID/AppFrameWork# gradle -version------------------------------------------------------------Gradle 4.6------------------------------------------------------------Build time:   2018-02-28 13:36:36 UTCRevision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46cGroovy:       2.4.12Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017JVM:          1.8.0_211 (Oracle Corporation 25.211-b12)OS:           linux 4.15.0-72-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 ANDROI全部内容,希望文章能够帮你解决SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROI所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1070153.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存