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]https://github.com/leoafarias/fvm/issues/638 report in fvm version:3.1.3 #707

Open
4 tasks
dujj opened this issue Apr 8, 2024 · 9 comments
Open
4 tasks
Labels
bug Something isn't working

Comments

@dujj
Copy link

dujj commented Apr 8, 2024

Before creating a bug report please make check the following

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

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to terminal..
  2. Run fvm use stable...
  3. Check...
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Logs
Please provide the verbose logs by running --verbose after the command.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • FVM Version [e.g. 22]
  • If Windows: Which Powershell are you using?

Additional context
Add any other context about the problem here.

@dujj dujj added the bug Something isn't working label Apr 8, 2024
@dujj
Copy link
Author

dujj commented Apr 8, 2024

企业微信截图_26fe03ca-eee8-4e00-b380-b98c4c5056a7

@leoafarias
Copy link
Owner

Can you tell me the version of fvm

also run the command with the --verbose flag as it will show which directories are looking at.

@dujj
Copy link
Author

dujj commented Apr 28, 2024

3.1.3

@leoafarias
Copy link
Owner

@dujj Can you run with the --verbose flag so we can see the directories that is lookin into for pubspec?

@dujj
Copy link
Author

dujj commented May 10, 2024

企业微信截图_2c38bb03-f2e3-4bc7-8f2f-5a10ca8344db

@leoafarias
Copy link
Owner

leoafarias commented May 11, 2024

@dujj Based on those logs, it seems there is an fvm config in that /work directory. So it's looking for the config file instead of the pubspec because of nested directories. Therefore, the message indicates that there is no pubspec found in the same directory where the project config is located.

@dujj
Copy link
Author

dujj commented May 13, 2024

  1. flutter create test
  2. cd test
  3. ls -a
  4. fvm use 3.19.6 --verbose
    `Argument information:
    Top level options:
  • verbose: true

Command: use

Searching for project in /Users/k/Documents/work/123/test
Searching for project in /Users/k/Documents/work/123
Searching for project in /Users/k/Documents/work
Found project config in /Users/k/Documents/work

No pubspec.yaml detected in this directory
✔ Would you like to continue? · yes

Updating project config
Project name: work
Project path: /Users/k/Documents/work

Checking .gitignore
Update gitignore: true
[WARN] Project is not a git repository.
But will set .gitignore as IDEs may use it,to determine what to index and display on searches,
.fvm/ already exists in .gitignore
Resolving dependencies...
Starting to update environment variables...

Running: /Users/k/fvm/versions/3.19.6/bin/flutter

✓ Dependencies resolved. (0ms)
Resolving dependencies...
meta 1.11.0 (1.12.0 available)
test_api 0.6.1 (0.7.0 available)
vm_service 13.0.0 (14.0.0 available)
Got dependencies!
3 packages have newer versions incompatible with dependency constraints.
Try flutter pub outdated for more information.

✓ Project now uses Flutter SDK : SDK Version : 3.19.6`

@dujj
Copy link
Author

dujj commented May 13, 2024

see :
test is new project created by flutter
Searching for project in /Users/k/Documents/work/123/test
Searching for project in /Users/k/Documents/work/123
Searching for project in /Users/k/Documents/work
Found project config in /Users/k/Documents/work

but:
Searching for project logs, show: project config in work

right:
Searching for project in /Users/k/Documents/work/123/test
test is project

project find failed, so all wrong

@dujj
Copy link
Author

dujj commented May 13, 2024

I clean work,result:
fvm use 3.19.6 --verbose

Argument information:
Top level options:

  • verbose: true

Command: use

Searching for project in /Users/k/Documents/work/123/test
Searching for project in /Users/k/Documents/work/123
Searching for project in /Users/k/Documents/work
Searching for project in /Users/k/Documents
Searching for project in /Users/k
Searching for project in /Users
Searching for project in /
No project found in /Users/k/Documents/work/123/test

Updating project config
Project name: test
Project path: /Users/k/Documents/work/123/test

Checking .gitignore
Update gitignore: true
[WARN] Project is not a git repository.
But will set .gitignore as IDEs may use it,to determine what to index and display on searches,
You should add the fvm version directory ".fvm/" to .gitignore.
✔ Would you like to do that now? · yes
✓ Added .fvm/ to .gitignore

✓ Project now uses Flutter SDK : SDK Version : 3.19.6

This operation was as expected

But I still don’t understand why the search is not in the current directory to determine whether there is a problem with the conditions of a project, and why it is searched recursively upwards.

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