1、使用命令行进行打包时,可用./gradlew assembleRelease --info >xxx.log 2>&1 将控制台编译过程输出到文件中
- xxx.log是保存输出的文件名称;
- 2>&1 表示不仅命令行正常的输出保存到xxx.log中,产生错误信息的输出也保存到xxx.log文件中;
- & 表示该进程在后台运行;
2、查看当前项目的lib依赖树,可以用./gradlew app(当前module名称):dependencies,显示效果如下
3、gradle编译过程问题
在编译中出现如下问题
Caused by: org.gradle.internal.service.ServiceCreationException: Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().
或是出现lock关键字,可清理./gradle文件中所有的lock文件
cd path/to/.gradle/
find . -name "*.lock" -delete