在我的flutter项目中,使用fvm,我将项目从flutter 2.0.6迁移到flutter 2.5.2。解决所有空安全问题后。当我尝试运行我的项目时出现以下错误:
\n$ fvm flutter run\nUsing hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".\nLaunching lib/main.dart on sdk gphone x86 in debug mode...\nRunning Gradle task 'assembleDebug'... \nAn exception has occurred in the compiler (1.8.0_242-release). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.\njava.lang.AssertionError: …
Run Code Online (Sandbox Code Playgroud) 我将fvm添加到我的项目中并像这样设置它。现在我可以运行所有命令,例如fvm use x.x.x
或fvm flutter pub get
。一切正常。
但是,当直接通过 VSCode 运行应用程序(“播放”按钮或快捷方式)时,它始终使用我最新的安装 SDK 版本。为什么不从当前的 flutter 版本开始?
这是我的settings.json
:
{
"dart.flutterSdkPaths": [
"/Users/usr/fvm/versions"
],
// Remove .fvm files from search
"search.exclude": {
"**/.fvm": true
},
// Remove from file watching
"files.watcherExclude": {
"**/.fvm": true
}
}
Run Code Online (Sandbox Code Playgroud)
我在这里缺少什么?如何配置fvm 才能与 VSCode 一起正常工作?
目前我的计算机上安装了 Flutter 版本 3.3,但我的项目适用于 2.5.3 所以我使用 fvm,我已经设置了所有内容,但是当我运行 melos bootstrap 时,我认为它只是运行命令“flutter pub get” ”而不是“fvm flutter pub get”
如何解决这个问题?