1

weird behavior here

flutter doctor first prints two lines like :

The system cannot find the specified path
The system cannot find the specified path

but continues the work :

[√] Flutter (Channel master, v1.12.16-pre.35, on Microsoft Windows [Version 10.0.14393], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 3.5)
[√] VS Code (version 1.40.2)
[√] Connected device (3 available)
• No issues found!

the problem is when I run the app in vs code terminal stops and just says

The system cannot find the specified path

but android studio does the job with no problem

I need the live share feature in vs code , so I need this IDE to work too (unfortunately)

complete terminal log after I run flutter run in vs code :

The system cannot find the path specified.
The system cannot find the path specified.
Launching lib\main.dart on LG M700 in debug mode...
Initializing gradle...                                                 -
Sending crash report to Google.
Crash report sent (report ID: 5e6da0b57190a836)
Initializing gradle...                                                 -Oops; flutter has exited 
unexpectedly.

   /Crash report written to C:\Users\H&M\AndroidStudioProjects\code_01\flutter_04.log;
please let us know at https://github.com/flutter/flutter/issues.
       /

and yes %path% is set correctly for flutter sdk and bin folder too in both user and system variables

Leo Ma
  • 1,021
  • 3
  • 14
  • 16

5 Answers5

2

[Solved]

the problem was with the weird character (&) in the Windows Account Name (username)

Steps to resolve :

  • since even after changing the username from the control panel , C:\Users\<"username"> folder's name won't change , created another user.

  • made it admin.

  • copied SDK folders to another Drive so that IDE could access them without admin permits (even opening IDE as admin didn't give admin privileges to it's terminal smh).

  • now VSCode works perfect like AS.
Leo Ma
  • 1,021
  • 3
  • 14
  • 16
0

it also happens when the path to your project has (&) too.

I removed that weird character and issue solved.

Yunnosch
  • 26,130
  • 9
  • 42
  • 54
  • 1
    Welcome to StackOverflow Furkan. But please be careful with your phrasing. Both "Thanks." and "Me too.", or anything which can be misread like that, are not considered an answer here on StackOverflow if it is the onlything in a post. So it is important to focus on the contribution to actually answer the question. Your post does contain such contribution and I deleted some parts to make that more obvious. Feel free to review and improve whatever I made ugly now. – Yunnosch Jun 28 '20 at 07:47
0

For those that don't have an '&' in any path, but still have the issue. Try any of these two solutions, they solved it for me.

First one: It could be a broken path in your env variables. You can check all paths by doing a simple "echo %PATH%" in your terminal and removing those that don't point to a valid location.

Second one: Another one that I found is that after uninstalling Anaconda it left out an AutoRun key in the command processor registry.

Check these places in regedit for broken links: Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

RodXander
  • 643
  • 7
  • 12
0

That is occured to me after uninstalling Anaconda After 1 week of searching, I find solution inside another problem's StackOverflow it related to commend for Windows 10.

@crisprog wrote answer below link

https://stackoverflow.com/a/66836989/10459469

0

Below steps worked for me:

  1. Download new flutter SDK from flutter.dev
  2. Extract the folder and replace flutter folder with new version
Guvanch
  • 838
  • 7
  • 10