赞
踩
最近在学习flutter,运行时碰到了这个错误。
I/flutter (25300): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (25300): The following RangeError was thrown building Home(dirty, state:
I/flutter (25300): _HomeState#6e135):
I/flutter (25300): RangeError (index): Invalid value: Valid value range is empty: 0
…
════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter (25300): Another exception was thrown: RangeError (index): Invalid value: Valid value range is empty: 0
在google上查了下,这是因为flutter使用gradle构建时出现的问题。
https://github.com/flutter/flutter/issues/17831
在Android Studio中打开terminal下,运行 flutter clean
$ flutter clean
两次运行项目就正常了。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。