Skip to content

dartdoc command not working (dartdoc failed: Invalid argument(s) (path): Must not be null) #2407

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

Closed
masteradit opened this issue Oct 24, 2020 · 6 comments · Fixed by #2440
Closed
Labels
customer-flutter Issues originating from important to Flutter P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@masteradit
Copy link

I tried to run C:\src\flutter\bin\cache\dart-sdk\bin\dartdoc.bat in my flutter app directory. But I got this error:

Documenting myapp...

dartdoc failed: Invalid argument(s) (path): Must not be null
#0      ArgumentError.checkNotNull (dart:core/errors.dart:194:27)
#1      _Directory._checkNotNull (dart:io/directory_impl.dart:276:19)
#3      new Directory (dart:io/directory.dart:129:18)
#4      PhysicalResourceProvider.getFolder (package:analyzer/file_system/physical_file_system.dart:87:31)
#5      PubPackageBuilder.sdk (package:dartdoc/src/model/package_builder.dart:85:43)
#6      PubPackageBuilder.buildPackageGraph (package:dartdoc/src/model/package_builder.dart:71:7)
<asynchronous suspension>
#7      Dartdoc.generateDocsBase (package:dartdoc/dartdoc.dart:181:41)
#8      Dartdoc.generateDocs (package:dartdoc/dartdoc.dart:222:34)
#9      Dartdoc.executeGuarded.<anonymous closure> (package:dartdoc/dartdoc.dart:500:15)
#10     _rootRun (dart:async/zone.dart:1190:13)
#11     _CustomZone.run (dart:async/zone.dart:1093:19)
#12     _runZoned (dart:async/zone.dart:1630:10)
#13     runZonedGuarded (dart:async/zone.dart:1618:12)
#14     Dartdoc.executeGuarded (package:dartdoc/dartdoc.dart:498:5)
#15     main (file:///C:/b/s/w/ir/cache/builder/src/third_party/dart/third_party/pkg/dartdoc/bin/dartdoc.dart:24:11)
<asynchronous suspension>
#16     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#17     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Is there any way to fix this error?

@CaptainIRS
Copy link
Contributor

This is possibly another variation of the problem causing #2279 and #1705. Can you try setting the environment variable FLUTTER_ROOT to the flutter SDK directory (C:\src\flutter in your case) and running dartdoc after that?

@masteradit
Copy link
Author

Thanks @CaptainIRS! C:\src\flutter\bin\cache\dart-sdk\bin\dartdoc.bat generates the doc files now. Though dartdoc command still does not work. Do I need to set some PATH variable to make it work?

@CaptainIRS
Copy link
Contributor

Yeah, you can add an entry C:\src\flutter\bin\cache\dart-sdk\bin to your existing PATH variable if you wish to use dartdoc directly.

@jcollins-g jcollins-g added customer-flutter Issues originating from important to Flutter P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Oct 26, 2020
@aymentoumi
Copy link

Same error on Linuxmint.

@masteradit
Copy link
Author

Yeah, you can add an entry C:\src\flutter\bin\cache\dart-sdk\bin to your existing PATH variable if you wish to use dartdoc directly.

This worked! Thanks again @CaptainIRS! Should I close the issue?

@jcollins-g
Copy link
Contributor

Please leave this issue open. dartdoc should not crash, even though there is a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-flutter Issues originating from important to Flutter P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants