简体   繁体   English

Flutter 缓存非常老的错误

[英]Flutter Caching Very Old Errors

1. The Problem 1. 问题

Usually, either flutter clean or deleting /build folder works for me.通常, flutter clean或删除/build文件夹对我有用。 But, recently, some errors have been cached for a long time and I just can't seem to be able to delete them.但是,最近,一些错误被缓存了很长时间,我似乎无法删除它们。 The cleaning process is also supposedly taking way longer than expected (+3s in my reasonably good computer).据推测,清洁过程的时间也比预期的要长(在我相当不错的计算机中为 +3 秒)。

The reason why I say it is caching error logs is that essentially all of it refers to silly typo mistakes I have fixed long ago or other types of easy-to-fix mistakes.我之所以说它缓存错误日志,是因为它基本上都是指我很久以前修复过的愚蠢的拼写错误或其他类型的易于修复的错误。 For example, 2 days ago (my computer rebooted 2 times since then), I've used an .email getter on an object that doesn't have it and the log is still there;例如,2 天前(我的计算机从那时起重新启动了 2 次),我在一个没有它的对象上使用了.email getter 并且日志仍然存在; or the fact that it is saying that I've used an invalid object on oneline, but now there is bascially nothing in that file anymore.或者它说我在 oneline 上使用了一个无效的对象,但现在那个文件中基本上什么都没有了。

The app also builds and runs perfectly after these long error messages, and, if I hot reload or hot restart it, no errors reappear.在这些长错误消息之后,该应用程序也可以完美地构建和运行,并且,如果我热重载热重启它,则不会再出现错误。

I would like to share my complete error log here, but a good part of it has a lot of personal data.我想在这里分享我的完整错误日志,但其中很大一部分包含大量个人数据。 It is also not very relevant I think, because it mostly refers to silly mistakes and typos.我认为它也不是很相关,因为它主要是指愚蠢的错误和拼写错误。

2. What I've tried so far 2. 到目前为止我尝试过的

Here is what I've tried so far:这是我迄今为止尝试过的:

  1. flutter clean
  2. Manually delete the /build folder手动删除/build文件夹
  3. Restart my IDE重新启动我的 IDE
    • These error messages appear both on VS Code (my current IDE) and Android Studio .这些错误消息同时出现在VS Code (我当前的 IDE)和Android Studio
  4. Use Ctrl + Shift + P + Clear Editor History to reset VS Code .使用Ctrl + Shift + P + Clear Editor History重置VS Code

Is there some hidden folder within a Flutter project that could be caching these data? Flutter项目中是否有一些隐藏文件夹可以缓存这些数据?

Apparently, there is some linkage between the Flutter project and the emulator itself , because wiping out the emulator's data seems to have solved the problem.显然, Flutter项目和模拟器本身之间存在某种联系,因为擦除模拟器的数据似乎已经解决了问题。

Was that supposed to happen?那是应该发生的吗? I think this should be treated as a Flutter issue — more specifically: flutter/flutter #45478 Github Issue .我认为这应该被视为Flutter问题——更具体地说: flutter/flutter #45478 Github 问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM