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

Exception: type null is not a subtype of type string when trying to use flutter/dart #53424

Closed
JesseRacine opened this issue Sep 4, 2023 · 3 comments

Comments

@JesseRacine
Copy link

JesseRacine commented Sep 4, 2023

I'm using Windows 11 and I'm trying to install Flutter/Dart. I downloaded the Flutter SDK version 3.13.2. I've unpacked it and added flutter/bin to the path. Trying to run "flutter doctor" was producing no output after installing it. I've cleared the dart cache, and now when I try to run flutter or dart I get this error:

Building flutter tool...
Running pub upgrade...
An unexpected error was encountered by the Dart CLI.
Please file an issue at https://github.com/dart-lang/sdk/issues/new with the following details:

Invocation: 'dart pub upgrade --suppress-analytics'
Exception: 'type 'Null' is not a subtype of type 'String''
Stack Trace:
#0      _Platform.resolvedExecutable (dart:io/platform_impl.dart:37:38)
#1      _Platform.resolvedExecutable (dart:io/platform_impl.dart)
#2      Platform.resolvedExecutable (dart:io/platform.dart:197:53)
#3      Sdk._createSingleton (package:dartdev/src/sdk.dart:82:58)
#4      Sdk._instance (package:dartdev/src/sdk.dart:15:32)
#5      Sdk._instance (package:dartdev/src/sdk.dart)
#6      sdk (package:dartdev/src/sdk.dart:11:21)
#7      sdk (package:dartdev/src/sdk.dart)
#8      sdkConstraint (package:dartdev/src/templates/common.dart:7:38)
#9      _pubspec (package:dartdev/src/templates/console.dart:45:12)
#10     _pubspec (package:dartdev/src/templates/console.dart)
#11     new ConsoleGenerator (package:dartdev/src/templates/console.dart:21:29)
#12     generators (package:dartdev/src/templates.dart:21:3)
#13     generators (package:dartdev/src/templates.dart)
#14     CreateCommand.legalTemplateIds (package:dartdev/src/commands/create.dart:23:23)
#15     new CreateCommand (package:dartdev/src/commands/create.dart:38:16)
#16     new DartdevRunner (package:dartdev/dartdev.dart:108:16)
#17     runDartdev (package:dartdev/dartdev.dart:58:20)
#18     main (file:///C:/b/s/w/ir/x/w/sdk/pkg/dartdev/bin/dartdev.dart:11:9)
#19     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:292:33)
#20     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)

Error (255): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)

**The main error seems to be "Exception: 'type 'Null' is not a subtype of type 'String''.**
@JesseRacine JesseRacine changed the title Create an issue Exception: type null is not a subtype of type string when trying to use flutter/dart Sep 4, 2023
@JesseRacine
Copy link
Author

It looks like this was a permissions issue in Windows. I was only able to use it as an administrator due to permissions on the flutter install folder.

@navaronbracke
Copy link

In https://docs.flutter.dev/get-started/install/windows it is stated that you should not put Flutter into a folder that requires extra privileges: Warning: Do not install Flutter in a directory like C:\Program Files\ that requires elevated privileges.

@mit-mit
Copy link
Member

mit-mit commented Sep 6, 2023

Closing as by design

@mit-mit mit-mit closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants