Skip to content

flutter build clean doesn't work #8656

@goderbauer

Description

@goderbauer

I am starting with a clean workspace:

C:\src\flutter\examples\flutter_gallery> git clean -xfd
C:\src\flutter\examples\flutter_gallery>

I am running flutter build apk:

C:\src\flutter\examples\flutter_gallery> flutter build apk
Running 'flutter packages get' in flutter_gallery...  7.0s
Running 'gradle assembleRelease'...
Building AOT snapshot in release mode (android-arm-release)... 15.5s
Built to C:\src\flutter\examples\flutter_gallery\android\app\build\intermediates\flutter\release\.
Built app-release.apk (17.8MB).
C:\src\flutter\examples\flutter_gallery>

This creates a whole bunch of build artifacts in all kinds of places:

C:\src\flutter\examples\flutter_gallery> git clean -xfd --dry-run
Would remove .packages
Would remove android/.gradle/
Would remove android/app/build/
Would remove android/build/
Would remove android/local.properties
Would remove pubspec.lock
C:\src\flutter\examples\flutter_gallery>

None of these are removed by flutter build clean (the build directory it claims to delete never existed):

C:\src\flutter\examples\flutter_gallery> flutter build clean
Deleting 'build\'.
C:\src\flutter\examples\flutter_gallery> git clean -xfd --dry-run
Would remove .packages
Would remove android/.gradle/
Would remove android/app/build/
Would remove android/build/
Would remove android/local.properties
Would remove pubspec.lock
C:\src\flutter\examples\flutter_gallery>

I have two issues with this:

  • flutter build clean should work as advertised and delete all build artifacts
  • It would be nice if build artifacts were contained in a single directory, that is safe to delete by hand

Metadata

Metadata

Assignees

Labels

toolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions