2016-07-28 64 views
0

每當我嘗試clean我的項目Build - > Clean Project在Android Studio 2.1中執行以下命令。這裏的搖籃控制檯輸出:如何清理Android Studio 2.1中的項目

Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] 

Configuration on demand is an incubating feature. 
Incremental java compilation is an incubating feature. 
:clean 
:app:clean 
:app:preBuild UP-TO-DATE 
:app:preDebugBuild UP-TO-DATE 
:app:checkDebugManifest 
:app:preReleaseBuild UP-TO-DATE 
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library 
:app:prepareComAndroidSupportAppcompatV72340Library 
:app:prepareComAndroidSupportSupportV42340Library 
:app:prepareComAndroidSupportSupportVectorDrawable2340Library 
:app:prepareDebugDependencies 
:app:compileDebugAidl 
:app:compileDebugRenderscript 
:app:generateDebugBuildConfig 
:app:mergeDebugShaders 
:app:compileDebugShaders 
:app:generateDebugAssets 
:app:mergeDebugAssets 
:app:generateDebugResValues UP-TO-DATE 
:app:generateDebugResources 
:app:mergeDebugResources 
:app:processDebugManifest 
:app:processDebugResources 
:app:generateDebugSources 
:app:preDebugAndroidTestBuild UP-TO-DATE 
:app:prepareDebugAndroidTestDependencies 
:app:compileDebugAndroidTestAidl 
:app:processDebugAndroidTestManifest 
:app:compileDebugAndroidTestRenderscript 
:app:generateDebugAndroidTestBuildConfig 
:app:mergeDebugAndroidTestShaders 
:app:compileDebugAndroidTestShaders 
:app:generateDebugAndroidTestAssets 
:app:mergeDebugAndroidTestAssets 
:app:generateDebugAndroidTestResValues UP-TO-DATE 
:app:generateDebugAndroidTestResources 
:app:mergeDebugAndroidTestResources 
:app:processDebugAndroidTestResources 
:app:generateDebugAndroidTestSources 
:app:mockableAndroidJar 
:app:preDebugUnitTestBuild UP-TO-DATE 
:app:prepareDebugUnitTestDependencies 

BUILD SUCCESSFUL 

Total time: 15.678 secs 

現在我只想清理項目不重建它。我發現了一個解決方案,通過進入Gradle Window並選擇clean來做到這一點,但有沒有更好的解決方案來做到這一點,因爲我的解決方案感覺像一個黑客攻擊。 Gradle Window Clean app screenshot你有什麼想法,爲什麼Android Studio的行爲如此

+0

我認爲亞行明確的調試程序命令就可做到 –

+0

'clean'手動不是哈克但通常的方式。或者你可以鍵入到你的平常的控制檯不僅android工作室gradle窗口。 – ytRino

+0

是的,但不乾淨只是應該「清理」該項目,而不是再次構建它。我可以在我想要的時候執行「Build」命令。 – Aadam

回答

1

這是Android studio clean項目的正常方式。首先,他們清理Gradle Build消息頂部提到的項目。

:乾淨 :應用程序:清潔

+0

是的,但不乾淨只是應該「清理」該項目,而不是再次構建它。我可以在我想要的時候執行「Build」命令。 – Aadam