执行gradle clean命令报错
gradle clean
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> * 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
BUILD FAILED in 0s
分析一下错误信息,发现是sdk的目录不对
解决方案:
①定位到项目的-->local.properties文件并打开
②将错误的路径 sdk.dir=D:\Android\sdk 更改自己的sdk所在目录 即可!
打开local.properties
nano local.properties
查看当前环境,android sdk 所在的位置(-即android home环境变量的值):/usr/local/android-home
修改:
再次执行:
gradle clean
看到 BUILD SUCCESSFUL的字样就表示成功了
参考了: