Android Studio 2.3.3中的“清理”和“重建”没有区别,那么为什么在“构建”菜单中都有这两个选项呢?
为什么在AS 2.3.3中,Android Studio 2.3.3中的“清理”和“重建”没有区别,那么为什么在“构建”菜单中都有这两个选项呢?,android,android-studio,build,android-gradle-plugin,Android,Android Studio,Build,Android Gradle Plugin,为什么在AS 2.3.3中,清理和重建是相同的,为什么在构建菜单中可以找到这两个选项? 如前所述,As 2.3.3中的BuildClean和BuildRebuild之间没有区别。只需检查事件日志即可验证这一点 因此,为什么不修改AS 2.3.3Build菜单,使其具有一个选项,例如,Clean and Rebuild。这是一个有趣的历史注释,Clean用于执行与Rebuild不同的操作,因此可能需要在菜单中同时使用这两个选项,但这很容易混淆 注意()在VisualStudio中,Clean和Re
清理
和重建
是相同的,为什么在构建
菜单中可以找到这两个选项?
如前所述,As 2.3.3中的Build
Clean
和Build
Rebuild
之间没有区别。只需检查事件日志
即可验证这一点
因此,为什么不修改AS 2.3.3Build
菜单,使其具有一个选项,例如,Clean and Rebuild
。这是一个有趣的历史注释,Clean
用于执行与Rebuild
不同的操作,因此可能需要在菜单中同时使用这两个选项,但这很容易混淆
注意()在VisualStudio中,Clean
和Rebuild
选项做了不同的事情,无疑与1.0中的操作非常相似
并指出Gradle4.1并不总是按照“预期”的顺序解释命令。这是否解释了为什么<代码> Cudio和
因此,在幕后,它们可能是相同的,但是结果以不同的方式呈现给用户。< P>我在代码的中间使用干净来更新R值。我不想知道我未完成的代码中有错误,我只希望R文件链接是最新的 另一方面,重建列出了所有错误
因此,在幕后,它们可能是相同的,但结果以不同的方式呈现给用户。@Sam是正确的。仅查看
事件日志是相当肤浅的,因为它
只记录事件,不记录详细信息。查看Gradle控制台
可以澄清这一切:
下面是我正在编译的代码中出现错误时清理的内容:
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
在任何情况下,Build
执行Clean
,然后编译代码,如果发现错误(并列出),则终止;否则,请执行完整编译
因此Clean
与Rebuild
不同
(这意味着其他一些帖子,比如上面列出的帖子,必须修改。)@Sam是正确的。仅查看事件日志是相当肤浅的,因为它
只记录事件,不记录详细信息。查看Gradle控制台
可以澄清这一切:
下面是我正在编译的代码中出现错误时清理的内容:
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
在任何情况下,Build
执行Clean
,然后编译代码,如果发现错误(并列出),则终止;否则,请执行完整编译
因此Clean
与Rebuild
不同
(这意味着其他一些职位,如所列职位,必须进行修改。)