01.Gradle问题汇总
目录介绍
- 01.gradle权限限制
01.gradle权限限制
今天在查看Android项目的依赖关系时,发现蜜汁好用的gradle命令权限被限制了:
yangchongdeMacBook-Pro:WeCardPalm yangchong$ ./gradlew -q app:dependencies
# 注意这行 被提示没有权限
bash: ./gradlew: Permission denied
最后在 stackoverflow-gradlew: Permission Denied找到了答案:
输入 chmod +x gradlew
该命令的作用是是Linux下去除执行权限。
#输入该命令
$ chmod +x gradlew
#检查权限,发现该命令可以用了
$ ./gradlew
yangchongdeMacBook-Pro:WeCardPalm yangchong$ ./gradlew
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details
> Task :help
Welcome to Gradle 6.1.1.
To run a build, run gradlew <task> ...
To see a list of available tasks, run gradlew tasks
To see a list of command-line options, run gradlew --help
To see more detail about a task, run gradlew help --task <task>
For troubleshooting, visit https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 10s
1 actionable task: 1 executed
通过这个问题,深深感觉到,只是单纯的懂得配置gradle是不够的,接下来更需要深入学习这门脚本语言。