5

I recently asked this question about Flutter. Currently, the answer now gives a different error and, as the answer states, I might want to look at this segment of the code. So, I decide to fork the repo and begin my investigation. I currently just want to print out a couple of values in the section to figure out what is going on. To see what the program thinks I have, and what it doesn't think I have. I added a couple of printTrace statements and now I want to rebuild the project.

I went to CONTRIBUTING.md and found this:

The flutter tools itself is built when you run flutter for the first time and each time you run flutter upgrade. If you want to alter and re-test the tool's behavior itself, locally commit your tool changes in git and the tool will be rebuilt from Dart sources in packages/flutter_tools the next time you run flutter.

I don't want to exactly "change" anything at the moment, just print out some values and figure out what is going on. The issue is, doing these debugging changes forces me to do a commit. Is there a way to rebuild flutter tools without making a commit?

Collin Jackson
  • 110,240
  • 31
  • 221
  • 152
Dair
  • 15,910
  • 9
  • 62
  • 107

1 Answers1

9

You can force the Flutter tools to rebuild by removing the build stamp. For example, if your Flutter install is in ~/.flutter-sdk, you can run

rm ~/.flutter-sdk/bin/cache/flutter_tools.stamp
Collin Jackson
  • 110,240
  • 31
  • 221
  • 152
  • I'm not sure if this worked. I tried adding a message that says "Hi" at [this line](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/android/android_workflow.dart#L94) I first deleted one file from the cache then slowly deleted every file from the cache to see if it would rebuild, but I never saw a "Hi" message or any other indication of rebuilding. Thanks for the response. – Dair Jun 11 '17 at 19:26
  • I added a print statement to the first line of main in executable.dart and it worked for me. When you say "flutter doctor" it should say "Building flutter tool..." then "hi" – Collin Jackson Jun 11 '17 at 20:35