尝试使用
connectivity_plus
包进行编译时,我在 Flutter 项目中遇到错误。我收到的错误消息是:
FAILURE: Build failed with an exception.
* What went wrong:
> error: invalid source release: 17
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
我尝试过:
当前的java版本是
18.0.2.1
早些时候我也遇到了同样的错误。我使用的是 Android Studio(电鳗)。当我转到“帮助 -> 关于”时,我看到运行时版本是 11。这对我有用:
3.之后,我只是通过 VS code 运行我的 flutter 应用程序,它成功了!希望上述解决方案也适用于您:)。