2017-11-08 4 views
0

AS 2.3.3에서 CleanRebuild이 동일한 이유는 무엇이며 Build 메뉴에 두 옵션이 모두 표시되는 이유는 무엇입니까?Android Studio 2.3.3에는 Clean과 Rebuild의 차이점이 없으므로 빌드 메뉴에 두 옵션이 모두있는 이유는 무엇입니까?

있듯이 here 설명, AS 2.3.3 Clean>Build 내지 Build>Rebuild의 차이없다. Event Log을 확인하기 만하면 확인할 수 있습니다.

그럼 AS 2.3.3 Build 메뉴를 수정하여 하나의 옵션 (예 : Clean and Rebuild)을 사용하지 마십시오. CleanRebuild과 다른 뭔가를 해왔다는 재미있는 역사적인 메모이므로 두 가지 모두 메뉴에 포함시킬 수는 있지만 혼란 스럽습니다.

Visual Studio에서 CleanRebuild 옵션 (supposedly)을 사용하면 1.0 에서처럼 완전히 다른 점을 알 수 있습니다.


P. thisthis은 Gradle 4.1이 항상 "예상 된"순서의 명령을 해석하지 않는다고 지적합니다. 왜 이것이 CleanRebuild이 같아야하는지 설명합니까?

답변

1

코드를 작성하는 동안 깨끗하게 R 값을 업데이트합니다. 내 미완성 된 코드에 오류가 있다는 것을 알고 싶지 않습니다. 단지 R 파일 링크를 최신 상태로 유지하기를 원합니다.

반면에 Rebuild는 모든 오류를 나열합니다.

그래서 뒤에서 동일 할 수도 있지만 결과는 사용자에게 다른 방식으로 표시됩니다.

1

@Sam이 정확합니다. Event log에서만 보이는 것은 매우 피상적입니다. 은 이벤트가 아닌 세부 정보 만 기록합니다. Gradle console 보면 모두를 명확히 :

여기

도 내가 컴파일하고있어 코드에서 오류가 무엇 Clean입니다 :

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

Configuration on demand is an incubating feature. 

Incremental java compilation is an incubating feature. 
:clean 
:app:clean 
:app: preBuild UP-TO-DATE 
(MY NOTE ^^^^^^^^ 
:app:preDebugBuild UP-TO-DATE 
:app:checkDebugManifest 
:app:preReleaseBuild UP-TO-DATE 
:app:prepareComAndroidSupportAnimatedVectorDrawable2600Alpha1Library 
:app:prepareComAndroidSupportAppcompatV72600Alpha1Library 
:app:prepareComAndroidSupportConstraintConstraintLayout102Library 
:app:prepareComAndroidSupportSupportCompat2600Alpha1Library 
:app:prepareComAndroidSupportSupportCoreUi2600Alpha1Library 
:app:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library 
:app:prepareComAndroidSupportSupportFragment2600Alpha1Library 
:app:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library 
:app:prepareComAndroidSupportSupportV42600Alpha1Library 
:app:prepareComAndroidSupportSupportVectorDrawable2600Alpha1Library 
:app:prepareDebugDependencies 
:app:compileDebugAidl 
:app:compileDebugRenderscript 
:app:generateDebugBuildConfig 
:app:generateDebugResValues 
:app:generateDebugResources 
:app:mergeDebugResources 
:app:processDebugManifest 
:app:processDebugResources 
:app:generateDebugSources 
:app:mockableAndroidJar 
:app:preDebugUnitTestBuild UP-TO-DATE 
:app:prepareDebugUnitTestDependencies 
:app:preDebugAndroidTestBuild UP-TO-DATE 
:app:prepareComAndroidSupportTestEspressoEspressoCore222Library 
:app:prepareComAndroidSupportTestEspressoEspressoIdlingResource222Library 
:app:prepareComAndroidSupportTestExposedInstrumentationApiPublish05Library 
:app:prepareComAndroidSupportTestRules05Library 
:app:prepareComAndroidSupportTestRunner05Library 
:app:prepareDebugAndroidTestDependencies 
:app:compileDebugAndroidTestAidl 
:app:processDebugAndroidTestManifest 
:app:compileDebugAndroidTestRenderscript 
:app:generateDebugAndroidTestBuildConfig 
:app:generateDebugAndroidTestResValues 
:app:generateDebugAndroidTestResources 
:app:mergeDebugAndroidTestResources 
:app:processDebugAndroidTestResources 
:app:generateDebugAndroidTestSources 

Rebuild는 모두 플러스 오류가에있다 경우 다음을 수행합니다 코드 :

:app:incrementalDebugJavaCompilationSafeguard 
:app:javaPreCompileDebug 
:app:compileDebugJavaWithJavac 
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). 

C:\Users\Dov\Desktop\SQhell\app\src\main\java\com\dslomer64\sqhell\MainActivity.java:221: error: not a statement 
x  return true; 
^ 
C:\Users\Dov\Desktop\SQhell\app\src\main\java\com\dslomer64\sqhell\MainActivity.java:221: error: ';' expected 
x  return true; 
^ 
2 errors 

:app:compileDebugJavaWithJavac FAILED 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':app:compileDebugJavaWithJavac'. 
> Compilation failed; see the compiler error output for details. 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

BUILD FAILED 

Total time: 16.398 secs 

코드에 오류가없는 경우, Rebuild이 수행합니다

,
:app:compileDebugNdk UP-TO-DATE 
:app:compileDebugSources 
:app:incrementalDebugUnitTestJavaCompilationSafeguard UP-TO-DATE 
:app:javaPreCompileDebugUnitTest 
:app:compileDebugUnitTestJavaWithJavac UP-TO-DATE 
:app:processDebugJavaRes UP-TO-DATE 
:app:processDebugUnitTestJavaRes UP-TO-DATE 
:app:compileDebugUnitTestSources UP-TO-DATE 
:app:incrementalDebugAndroidTestJavaCompilationSafeguard 
:app:javaPreCompileDebugAndroidTest 
:app:compileDebugAndroidTestJavaWithJavac 
:app:compileDebugAndroidTestNdk UP-TO-DATE 
:app:compileDebugAndroidTestSources 

BUILD SUCCESSFUL 

Total time: 26.83 secs 

어떤 경우에도 BuildClean을 수행 한 다음 오류가 발견되면 (나열된 경우) 종료 코드를 컴파일합니다. 그렇지 않으면 전체 컴파일을 수행합니다.

따라서 CleanRebuild과 다릅니다.

(이는 질문에 나열된 것과 같은 다른 게시물을 수정해야 함을 의미합니다.)