Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot change versions to use Dart<3.0 compatible projects #715

Open
yieniggu opened this issue Apr 15, 2024 · 4 comments
Open

[BUG] Cannot change versions to use Dart<3.0 compatible projects #715

yieniggu opened this issue Apr 15, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@yieniggu
Copy link

Before creating a bug report please make check the following

  • [ x] You have read our FAQ
  • [ x] If you have used flutter. Please install correctly, run pub cache repair. Close the terminal and try again.
  • [ x] If you are on Windows. Make sure you are running the terminal as administrator or with developer permissions.
  • [ x] Run fvm doctor if possible and add the output to the issue.

Describe the bug
I set the latest stable version of flutter as global and it works fine, I just created and tested a project.
fvm flutter doctor ouputs:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.5, on Ubuntu 22.04.4 LTS 6.5.0-27-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2023.2)
[✓] VS Code (version 1.88.1)
[✓] Connected device (3 available)
[✓] Network resources

However I'm trying to reproduce an example where Dart version is >=2.12.0 <=3.0.0. I try to use flutter v3.7.12 wich uses dart v2.19.6 to meet the constraints. However when I change the version with fvm use 3.7.12, flutter doctor outputs:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.12, on Ubuntu 22.04.4 LTS 6.5.0-27-generic, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ No Java Development Kit (JDK) found; You must have the environment variable JAVA_HOME set and the java binary in your PATH. You can download the JDK from
      https://www.oracle.com/technetwork/java/javase/downloads/.
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (version 2023.2)
    ✗ Unable to find bundled Java version.
[✓] VS Code
[✓] Connected device (3 available)
[✓] HTTP Host Availability

And when I try to run the app on debug mode:

Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
main.dart:1
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Exception: Gradle task assembleDebug failed with exit code 1

Honestly don't know if this is the expected behaviour or need some extra steps. Thanks in advance for any help!

@yieniggu yieniggu added the bug Something isn't working label Apr 15, 2024
@leoafarias
Copy link
Owner

@yieniggu I need to know the version of FVM. Also, if you are using VSCode, after you switch, can you clear the terminal and just run "flutter" without the FVM prefix? FVM configures the Flutter VSCode settings, so in this case, it would not proxy the commands anymore, which might provide better visibility on what the problem could be.

@yieniggu
Copy link
Author

I'm indeed using vs and after switching the version I can run flutter commands.
image

FVM version is 3.1.3

@leoafarias
Copy link
Owner

If this issue does not happen on the latest stable when you do the same thing, it does not seem that this would be an fvm issue, the commands are not been proxied in this case.

@yieniggu
Copy link
Author

I changed the version to a much older one (2.0.0) and set it as global. Still getting the same output, or do I need to take extra steps?

  ╔════════════════════════════════════════════════════════════════════════════╗
  ║ A new version of Flutter is available!                                     ║
  ║                                                                            ║
  ║ To update to the latest version, run "flutter upgrade".                    ║
  ╚════════════════════════════════════════════════════════════════════════════╝


Downloading Material fonts...                                      866ms
Downloading Gradle Wrapper...                                      244ms
Downloading package sky_engine...                                1,349ms
Downloading flutter_patched_sdk tools...                         1,480ms
Downloading flutter_patched_sdk_product tools...                 1,527ms
Downloading linux-x64 tools...                                   2,376ms
Downloading linux-x64/font-subset tools...                       1,136ms
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.0, on Linux, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ No Java Development Kit (JDK) found; You must have the environment variable JAVA_HOME set and the java binary in your PATH. You can download the JDK from
      https://www.oracle.com/technetwork/java/javase/downloads/.
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] Connected device (2 available)

! Doctor found issues in 2 categories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants