Android 显示旧错误的颤振

Android 显示旧错误的颤振,android,flutter,visual-studio-code,Android,Flutter,Visual Studio Code,我正在编写一个颤振应用程序,但当我想在Android仿真器(Ctrl+F5)上测试它时,我得到了一个不可纠正的错误。这是其中的一部分: I/flutter (13782): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════ I/flutter (13782): The following assertion was thrown during p

我正在编写一个颤振应用程序,但当我想在Android仿真器(Ctrl+F5)上测试它时,我得到了一个不可纠正的错误。这是其中的一部分:

I/flutter (13782): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (13782): The following assertion was thrown during performResize():
I/flutter (13782): Vertical viewport was given unbounded height.
I/flutter (13782): Viewports expand in the scrolling direction to fill their container. In this case, a vertical
I/flutter (13782): viewport was given an unlimited amount of vertical space in which to expand. This situation
I/flutter (13782): typically happens when a scrollable widget is nested inside another scrollable widget.
I/flutter (13782): If this widget is always nested in a scrollable widget there is no need to use a viewport because
I/flutter (13782): there will always be enough vertical space for the children. In this case, consider using a Column
I/flutter (13782): instead. Otherwise, consider using the "shrinkWrap" property (or a ShrinkWrappingViewport) to size
I/flutter (13782): the height of the viewport to the sum of the heights of its children.
I/flutter (13782):
I/flutter (13782): The relevant error-causing widget was:
I/flutter (13782):   ListView  (file:///D:/flutterProjects/test_project/test_project/lib/screens/all_obj_screen.dart:19:18)
正如您在最后一行中看到的,它指出错误的原因是
D:/projects/test\u project/test\u project/lib/screens/all\u obj\u screen.dart中的
ListView
。问题是,我在该文件中没有
ListView
(目前,但我以前有过),而且该路径甚至不再存在

如果有帮助,这是
所有对象屏幕.dart
文件:

class AllObjScreen extends StatefulWidget {
  @override
  _AllObjScreenState createState() => _AllObjScreenState();
}

class _AllObjScreenState extends State<AllObjScreen> {
  @override
  Widget build(BuildContext context) {
    final objects = Provider.of<Objs>(context);

    return Center(
      child: Text(
        '${objects.items.length}',
        style: TextStyle(
          color: Colors.white,
          fontSize: 25,
        ),
      ),
    );
  }
}
class AllObjScreen扩展StatefulWidget{
@凌驾
_AllObjScreenState createState()=>_AllObjScreenState();
}
类_AllObjScreenState扩展状态{
@凌驾
小部件构建(构建上下文){
final objects=Provider.of(上下文);
返回中心(
子:文本(
“${objects.items.length}”,
样式:TextStyle(
颜色:颜色,白色,
尺寸:25,
),
),
);
}
}
所以我认为问题不在于我的代码,而在于VisualStudio代码。如何解决这个问题

编辑: 我曾尝试在VisualStudio代码和Android Studio上运行该应用程序,但问题是相同的。
我也尝试重新安装IDE和Flatter,但没有成功。

自1.12版以来,我也遇到了同样的问题。 重新启动设备会清除日志,但我希望颤振会在将来的版本中纠正这一点。
这只是使用android设备时发生的。在iOS中工作正常。

简短的回答是:删除该设备(仿真器)并创建另一个新设备

长话短说:

我也有同样的问题!代码是完美的,突然没有任何改变,我得到了一个基于不应该被触发的事件的错误列表

我尝试了
flatterclean
,但它没有解决问题,尝试了所有方法,甚至我删除了所有处理错误触发事件的代码,但我没有幸发现错误不断出现,而没有代码生成它们

直到我想到尝试另一个模拟器,奇迹发生了!没有错误

试试看:

flutter logs -c
(要清除日志,请在项目目录中运行)

清洁过程结束后,按CTRL+C,然后回答Y以了解下面的问题。希望这会有帮助。Thx

您可以看到它:。
此问题在Flatter版本1.12.13+hotfix8中已修复。

我的Flatter应用程序也有同样的问题,如果你热重启应用程序,它会消失,直到你完全重启应用程序,你必须再次热重启它。但是,您可以运行
flutter clean
,它应该会消失。嗯,它可能是某种缓存构建吗?清理缓存、重新安装、关闭并重新打开。。等等?@Benjamin我试着热装,甚至用颤振清理,但问题仍然存在there@PFuster我已经试着做了所有这些事情…我会在FlatterGithub上提交一个问题。这对我很有效。