1

I wrote by mistake gradlew clear instead of gradlew clean in my react-native project's android folder, and I see that it does some serious work. So what is this doing and what is the difference between gradlew's clear vs clean? I could not find documentation.

Also it would be good to understand: When I run gradlew.bat it seems I'm running a java class. Where is the clean and where is the clear java class? Or is this some internal command of the gradlew (java) program?

pashute
  • 3,965
  • 3
  • 38
  • 65
  • Tried searching the docs? https://docs.gradle.org/current/userguide/userguide.html Clean, at least, is specific to the plugins that are used, such as removing the build artifacts in Java/Android – OneCricketeer Aug 19 '18 at 04:39
  • 1
    I've never seen the task `clear` in Gradle or any 3rd party plugin, so maybe you should add the output when calling `gradlew clear` to your question. Regarding the second part of your question, I'll suggest you to get some insight on Gradle starting with the popular question [What is Gradle in Android Studio?](https://stackoverflow.com/q/16754643). – Lukas Körfer Aug 19 '18 at 20:49

1 Answers1

0

OK, so the serious work is "loading 6/6 projects" and then after a while of churning away it says:

C:\dev\devreact\noam\android>gradlew clear
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
Task 'clear' not found in root project 'noam'. 
Some candidates are: 'clean'.

* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 49.374 secs   

So there is no gradlew clear

About the clean: you can glean much information by reading this: https://www.labkey.org/Documentation/wiki-page.view?name=gradleClean

The Gradle docs say nothing about cleaning and do not really explain the internals of Gradle.

pashute
  • 3,965
  • 3
  • 38
  • 65