Flutter doctor is not working - flutter

C:\Windows\system32>flutter doctor
Unhandled exception: ProcessException: %1 is not a valid Win32
application.
Command: C:\Program Files\Git\cmd\git.EXE rev-parse --abbrev-ref --symbolic #{u}

It seems like a potential issues involving tooling/Android SDK paths with spaces. Per this thread:
Moving some recent discussion over from
#9976 (older issue):
Potential issues involve tooling/Android SDK paths with spaces. We
currently run all CI with spaces in the SDK path. Since we build the
Gallery example (which is nested under the SDK), we're also covering
the case where the user Flutter project directory contains a space.
Other issues I can imagine that AFAIK we don't test for in our CI, but
probably should:
Space in Android SDK path (all OSes)
Space in Xcode path (on macOS)
Space in path of command-line tools such as ideviceinstaller, git, etc. (all OSes)
And looks like this issue was resolved by the Dart SDK fix that was landed in master channel.

Related

Invalid argument(s: A directory corresponding to fileSystemPath /Users/user/.pub-cache/hosted/pub.dartlang.org/devtools-2.9.2/build could not be found

Somehow the "build" directory doesn't exist within devtools-2.9.2 directory. I am getting this exception only while running the build on iPhone SE 2nd generation iOS 14.5 simulator though, which is weird. This began after an unexpected forced reboot of my mac. But I can not directly connect this event.
What is happening and how can I build this stuff or get rid of exceptions? And what is the cause?
flutter doctor -v No issues found
It seems like the new 2.9.2 release doesn't have the required "build" folder.
You can try fixing it by running this in the terminal:
dart pub global activate devtools -v 2.8.0
which downgrades the version to 2.8.0 (that works fine).
Answer from github.
run the following code and it'll get solved.
dart pub global activate devtools -v 2.8.0
DevTools is no longer being shipped via pub and is now part of the Dart SDK. 2.9.2 was published unintentionally this morning and has since been retracted.
How were you starting DevTools? You might want to file an issue on the DevTools repository if you're still having issues and I (#bkonyi) can help you out further there.

Flutter - Could not find a command named "-"

I'm new to flutter, when I created a new project of flutter and run it, this appears :
Using hardware rendering with device AOSP on IA Emulator. If you notice graphics artifacts,
consider enabling software rendering with "--enable-software-rendering".
Launching lib\main.dart on AOSP on IA Emulator in debug mode...
Could not find a command named "-".
Usage: dart [<vm-flags>] <command|dart-file> [<arguments>]
Global options:
-h, --help Print this usage information.
-v, --verbose Show additional command output.
--version Print the Dart SDK version.
--enable-analytics Enable anonymous analytics.
--disable-analytics Disable anonymous analytics.
Available commands:
analyze Analyze the project's Dart code.
compile Compile Dart to various formats.
create Create a new project.
fix Apply automated fixes to Dart source code.
format Idiomatically format Dart source code.
migrate Perform a null safety migration on a project or package.
pub Work with packages.
run Run a Dart program.
test Run tests in this package.
Run "dart help <command>" for more information about a command.
See https://dart.dev/tools/dart-tool for detailed documentation.
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 510ms
Exception: Gradle task assembleDebug failed with exit code 64
I'm stuck with this problem, how to solve this?
I have solved this problem. I run this project in my D: directory while my flutter and android SDK was installed in C: directory. So, when I tried to create flutter project in C:, it worked. But, I still can't configure why this problem happened.
#Papskipapap may I ask, if running your project on D: also inculded some path name which contained a "-" (dash) in it? As a rule of thumb: Keep pathnames easy, i.e. without blanks or special characters other than "_" (underscore), many tools just can not handle those...

How can install Flutter Correctly in Windows

I use this line in C:\src
git clone -b stable https://github.com/flutter/flutter.git
And in PATH i type this line:
C:\src\flutter\bin
Then
flutter doctor
but output is :
How can i install Flutter correctly?
some error is:
Error: 'pub upgrade' still failing after 10 tries, giving up.
Error: Error when reading '.packages': The system cannot find the file specified.
Error: Error when reading '../../bin/cache/flutter_tools.snapshot': The system cannot find the file specified.
I had the same problem days ago, what I did is
Remove cache folder inside bin/cache
Run flutter doctor again
Also I just cloned the master branch and then run flutter doctor
git clone -b master https://github.com/flutter/flutter.git
And if it doesn't work, most likely is what #user11945700 is saying, something about Antivirus or Firewall, so I recommend you to disable everything, install it, and then activate again.
Otherwise if you want other version you may use this to dowload Flutter releases versions
Another guess, could you install it if you run the prompt shell as administrator?
I use this link
https://flutter.dev/docs/development/tools/sdk/releases?tab=windows
extract file in C:/src
in
C:/src/flutter/bin
Run:
flutter doctor
This link help you to install Flutter:
https://www.aparat.com/v/Da9IN/%D8%A2%D9%85%D9%88%D8%B2%D8%B4_%DA%A9%D8%A7%D9%85%D9%84_%D9%86%D8%B5%D8%A8_flutter
If in your system antivirus or firewall is there then mostly its due to that. try after suspending antivirus and firewall
You also have one option directly download stable version from here - https://flutter.dev/docs/development/tools/sdk/releases

Why flutter doctor doesn't verify everything up correctly?

I follow the flutter documentation correctly. I'm done installing flutter SDK, put it at the correct path(c:\src\flutter[my flutter]), open the flutter_console.bat, locate at the command line cd c:/src/flutter, run flutter doctor, to see if there is anythin I need to do, I found one
And I get this error
Error: The Flutter directory is not a clone of the GitHub project.
The flutter tool requires Git in order to operate properly;
to set up Flutter, run the following command:
git clone -b stable https://github.com/flutter/flutter.git
And run the following command cd c:/src/flutter> git clone -b stable https://github.com/flutter/flutter.git base on what the flutter doctor says
After, I run flutter doctor again, and GET THE SAME ERROR.
Am I wrong?
I have the command prompt and powershell 5.1, my system requirements fits the criteria on running flutter apps.
I expect I don't have any issue running flutter doctor again
It seems you got the wrong path of the SDK.
Maybe this is a bug with flutter doctor.
Check yout flutter SDK version first,the latest version have fixed the issue.

Visual Studio in OSX: Installing Android SDK Platform-Tools v26.0.0 failed

I'm trying to compile to Android using Unity3D. The normal procedure is installing Android Studio. However I want to use Visual Studio Community (Preferences -> SDK Locations -> Android) to avoid downloading Android Studio because I do not plan to use it:
The rest of components seems to be installed well. However the Android SDK Platform-Tools installation outputs the following error:
Installing Android SDK Platform-Tools v26.0.0 failed
Could not find a
part of the path
"/Users/username/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/package.xml".
I have been able to install it after creating an empty folder named platform-tools manually. Unfortunately it seems it has not been installed correctly because the folder only contains one file named: package.xml of much less than 7 Mb. Unity also output the following error:
Android SDK is outdated
SDK Tools version 0.0.0 < 24.0.0.
Workarounds seem easy (both can be downloaded from here: https://developer.android.com/studio/index.html):
Install Android Studio: it seems the easier and quick way, but >500Mb HardDisk space
Install only command line tools: not so easy and quick
However I guess I'm very stubborn and curious: why could it be failing?
Hey mate for me it worked to create the missing folder manually.
So this folder:
/Users/username/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/
Is actually missing so if you do this:
$ cd /Users/username/Library/Developer/Xamarin/android-sdk-macosx/
$ mkdir platform-tools
And try to run the installer from VS UI
it should install the platform-tools package.
Complement from #benjamingranados:
Also check that the destiny folder in the "Locations" Tab is the same.