15

Somehow the "build" directory doesn't exist within devtools-2.9.2 directory. I am getting this exception only while running the build on iPhone SE 2nd generation iOS 14.5 simulator though, which is weird. This began after an unexpected forced reboot of my mac. But I can not directly connect this event.

What is happening and how can I build this stuff or get rid of exceptions? And what is the cause?

flutter doctor -v No issues found

MendelG
  • 14,885
  • 4
  • 25
  • 52
discodancer
  • 163
  • 1
  • 7

3 Answers3

28

It seems like the new 2.9.2 release doesn't have the required "build" folder. You can try fixing it by running this in the terminal:

dart pub global activate devtools -v 2.8.0

which downgrades the version to 2.8.0 (that works fine). Answer from github.

MendelG
  • 14,885
  • 4
  • 25
  • 52
Emmanuel .C
  • 298
  • 2
  • 6
4

run the following code and it'll get solved.

dart pub global activate devtools -v 2.8.0
AMAL MOHAN N
  • 1,416
  • 2
  • 14
  • 26
0

DevTools is no longer being shipped via pub and is now part of the Dart SDK. 2.9.2 was published unintentionally this morning and has since been retracted.

How were you starting DevTools? You might want to file an issue on the DevTools repository if you're still having issues and I (@bkonyi) can help you out further there.

Ben Konyi
  • 2,849
  • 12
  • 20
  • I just hit Run 'main.dart' in Android Studio and see the exception in Run section. Should I create an issue on repo or can fix it locally somehow by myself? – discodancer Dec 21 '21 at 00:06
  • Ah I see. I'm not sure if the Android Studio plugin has been updated to use the DevTools packaged with the SDK (or maybe you're on an older version). One thing that _should_ fix things is completely deleting your `.pub_cache` (located at `~/.pub_cache` on Linux/Mac and at `%LOCALAPPDATA%\Pub\Cache` on Windows) and then trying to run again. This will force Android Studio to pull down all your dependencies again, which should include the last pre-2.9.2 version of DevTools. If that doesn't work, you'll want to file an issue as then there's something else going on. – Ben Konyi Dec 21 '21 at 00:37
  • Is deleting it safe operation? Looks risky – discodancer Dec 21 '21 at 02:29
  • https://github.com/flutter/devtools/issues/3550 - raised an issue. – Ayush Mandowara Dec 21 '21 at 08:12
  • 1
    Yes, that's safe to do, although `dart pub global activate devtools -v 2.8.0` is a better solution. – Ben Konyi Dec 21 '21 at 17:22