如何知道gradlew使用哪个Android SDK?例如,当我运行./gradlew dist
时,如何知道它在磁盘上寻找Android SDK的位置?
类似的问题是Where is android SDK location?,但它已经过时了,没有具体询问gradlew。
答案 0 :(得分:0)
似乎./gradlew dist
寻找在local.properties sdk.dir
参数中引用的Android SDK。
我通过将sdk.dir
参数更改为无效目录(/Users/me/Library/Android/ZZZsdk
)进行了测试,这在运行./gradlew dist
时给了我以下错误:
my-project[develop]08:48:11 ./gradlew dist
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> The SDK directory '/Users/me/Library/Android/ZZZsdk' does not exist.
* 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