gradlew在哪里寻找Android SDK?

时间:2018-09-07 15:57:39

标签: android-gradle

如何知道gradlew使用哪个Android SDK?例如,当我运行./gradlew dist时,如何知道它在磁盘上寻找Android SDK的位置?

类似的问题是Where is android SDK location?,但它已经过时了,没有具体询问gradlew。

1 个答案:

答案 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