用户工具

站点工具


gradle

Gradle

Gradle 是一个Android常用的项目自动化建构工具。

Proxy

Gradle从bintray.com下载文件非常慢,可设置代理加速下载[(cite:>大家都是怎样处理Gradle中的这个文件下载慢的问题的?)]:

$HOME/.gradle/gradle.properties
org.gradle.daemon=true
org.gradle.jvmargs=-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=1080

Usage

Gradle 默认读取当前目录下的 build.gradle 文件。

列出所有任务:

gradle tasks

Troubleshoot

First build error: You have not accepted the SDK license agreements

You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 25].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

Answer: http://stackoverflow.com/a/38381577

mkdir -p "$ANDROID_HOME/licenses"
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"

Reference

gradle.txt · 最后更改: 2023/12/03 10:24 由 127.0.0.1