[英]Difference between clean, gradlew clean
What is the difference between the following statements when issued from a Android Studio Project's terminal :从 Android Studio 项目的终端发出以下语句有什么区别:
Android_Studio_Project_Path: ./gradlew clean Android_Studio_Project_Path: ./gradlew clean
Android_Studio_Project_Path: ./gradlew clean assembleDebug Android_Studio_Project_Path: ./gradlew clean assembleDebug
Android_Studio_Project_Path: ./gradlew clean :assembleDebug Android_Studio_Project_Path: ./gradlew clean :assembleDebug
and normal Android Studio --> Build --> Clean.和普通的 Android Studio --> Build --> Clean。
What would be the difference in the internal process.内部流程会有什么不同。
./gradlew clean
Uses your project's gradle wrapper to execute your project's clean
task.使用项目的gradle 包装器来执行项目的clean
任务。 Usually, this just means the deletion of the build directory.通常,这只是意味着删除构建目录。
./gradlew clean assembleDebug
Again, uses your project's gradle wrapper to execute the clean
and assembleDebug
tasks, respectively.同样,使用项目的 gradle 包装器分别执行clean
和assembleDebug
任务。 So, it will clean first, then execute assembleDebug
, after any non-up-to-date dependent tasks.因此,它将首先清理,然后在任何非最新相关任务之后执行assembleDebug
。
./gradlew clean :assembleDebug
Is essentially the same as #2.与#2 基本相同。 The colon represents the task path.冒号代表任务路径。 Task paths are essential in gradle multi-project's , not so much in this context.任务路径在gradle multi-project's中是必不可少的,在这种情况下并不是那么重要。 It means run the root project's assembleDebug task.这意味着运行根项目的 assembleDebug 任务。 Here, the root project is the only project.在这里,根项目是唯一的项目。
Android Studio --> Build --> Clean
Is essentially the same as ./gradlew clean
.本质上与./gradlew clean
相同。 See here .见这里。
For more info, I suggest taking the time to read through the Android docs, especially this one .有关更多信息,我建议花时间阅读 Android 文档,尤其是这个。
You should use this one too:你也应该使用这个:
./gradlew :app:dependencies
(Mac and Linux) - With ./ ./gradlew :app:dependencies
(Mac 和 Linux) -使用./
gradlew :app:dependencies
(Windows) - Without ./ gradlew :app:dependencies
(Windows) -没有./
The libs you are using internally using any other versions of google play service.If yes then remove or update those libs.您在内部使用任何其他版本的 google play 服务的库。如果是,则删除或更新这些库。
You can also use你也可以使用
./gradlew clean build
(Mac and Linux) -With ./ ./gradlew clean build
(Mac 和 Linux) - 带有 ./
gradlew clean build
(Windows) -Without ./ gradlew clean build
(Windows) - 没有 ./
it removes build folder, as well configure your modules and then build your project.它删除构建文件夹,以及配置您的模块,然后构建您的项目。
i use it before release any new app on playstore.我在 Playstore 上发布任何新应用程序之前使用它。
兄弟,这个问题确实得到了 69 票。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.