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

fix: Plugin creation throws PathNotFoundException in Windows #728

Open
yahu1031 opened this issue May 1, 2023 · 10 comments
Open

fix: Plugin creation throws PathNotFoundException in Windows #728

yahu1031 opened this issue May 1, 2023 · 10 comments
Labels
bug Something isn't working as expected p2 Important issues not at the top of the work list

Comments

@yahu1031
Copy link

yahu1031 commented May 1, 2023

Description
Creating a flutter plugin throws PathNotFound Exception. These exceptions must be handled by some error statements.

Steps To Reproduce

  1. Upgraded flutter from 3.7.3 - 3.7.12
  2. Install vgv CLI
  3. very_good create flutter_plugin sky_client

Now you see this error.

PS C:\Users\yaswa\Desktop> very_good create flutter_plugin sky_client
Unhandled exception:
PathNotFoundException: Directory listing failed, path = 'C:\Users\yaswa\AppData\Local\Mason\Cache\bundled\very_good_flutter_plugin_0.3.3_22878f28a4fe654485c306b2b7c238e94c4ec37c\__brick__\{{project_name.snakeCase()}}\{{#android}}{{project_name.snakeCase()}}_android{{\android}}\android\src\main\kotlin\{{org_name.pathCase()}}\*' (OS Error: The system cannot find the path specified.
, errno = 3)
#0      _Directory._fillWithDirectoryListing (dart:io-patch/directory_patch.dart:42:24)
#1      _Directory.listSync (dart:io/directory_impl.dart:233:5)
#2      MasonGenerator._fromBrick (package:mason/src/generator.dart:91:14)
#3      MasonGenerator.fromBundle (package:mason/src/generator.dart:70:27)
<asynchronous suspension>
#4      CreateSubCommand.run (package:very_good_cli/src/commands/create/commands/create_subcommand.dart:199:23)
<asynchronous suspension>
#5      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#6      VeryGoodCommandRunner.runCommand (package:very_good_cli/src/command_runner.dart:211:18)
<asynchronous suspension>
#7      VeryGoodCommandRunner.run (package:very_good_cli/src/command_runner.dart:148:14)
<asynchronous suspension>
#8      main (file:///C:/Users/yaswa/AppData/Local/Pub/Cache/hosted/pub.dev/very_good_cli-0.13.1/bin/very_good.dart:5:24)
<asynchronous suspension>
Unhandled exception:
PathNotFoundException: Directory listing failed, path = 'C:\Users\yaswa\AppData\Local\Mason\Cache\bundled\very_good_flutter_plugin_0.3.3_22878f28a4fe654485c306b2b7c238e94c4ec37c\__brick__\{{project_name.snakeCase()}}\{{#android}}{{project_name.snakeCase()}}_android{{\android}}\android\src\main\kotlin\{{org_name.pathCase()}}\*' (OS Error: The system cannot find the path specified.
, errno = 3)
#0      _Directory._fillWithDirectoryListing (dart:io-patch/directory_patch.dart:42:24)
#1      _Directory.listSync (dart:io/directory_impl.dart:233:5)
#2      MasonGenerator._fromBrick (package:mason/src/generator.dart:91:14)
#3      MasonGenerator.fromBundle (package:mason/src/generator.dart:70:27)
<asynchronous suspension>
#4      CreateSubCommand.run (package:very_good_cli/src/commands/create/commands/create_subcommand.dart:199:23)
<asynchronous suspension>
#5      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#6      VeryGoodCommandRunner.runCommand (package:very_good_cli/src/command_runner.dart:211:18)
<asynchronous suspension>
#7      VeryGoodCommandRunner.run (package:very_good_cli/src/command_runner.dart:148:14)
<asynchronous suspension>
#8      main (file:///C:/Users/yaswa/AppData/Local/Pub/Cache/hosted/pub.dev/very_good_cli-0.13.1/bin/very_good.dart:5:24)
<asynchronous suspension>

Expected Behavior
Should create a federated plugin code.

Additional Context

  • very_good_cli - 0.13.1
Edition	Windows 11 Pro Insider Preview
Version	22H2
Installed on	‎20-‎01-‎2023
OS build	25281.1000
Experience	Windows Feature Experience Pack 1000.25281.1000.0
@yahu1031 yahu1031 added the bug Something isn't working as expected label May 1, 2023
@yahu1031
Copy link
Author

yahu1031 commented May 1, 2023

Verbose logs
PS C:\Users\yaswa\Desktop> very_good create flutter_plugin sky_client --verbose
Argument information:
  Top level options:
  - verbose: true
  Command: create
    Command options:
    Command sub command: flutter_plugin
Running with analytics enabled.
Building generator from brick: very_good_flutter_plugin ^0.3.3
Building generator from brick failed: PathNotFoundException: Directory listing failed, path = 'C:\Users\yaswa\AppData\Local\Mason\Cache\hosted\registry.brickhub.dev\very_good_flutter_plugin_0.3.3\__brick__\{{project_name.snakeCase()}}\{{project_name.snakeCase()}}\example\{{#android}}android{{\android}}\app\src\main\kotlin\com\example\{{project_name.snakeCase()}}\*' (OS Error: The system cannot find the path specified.
, errno = 3)
Building generator from bundle very_good_flutter_plugin 0.3.3
Unhandled exception:
PathNotFoundException: Directory listing failed, path = 'C:\Users\yaswa\AppData\Local\Mason\Cache\bundled\very_good_flutter_plugin_0.3.3_22878f28a4fe654485c306b2b7c238e94c4ec37c\__brick__\{{project_name.snakeCase()}}\{{#android}}{{project_name.snakeCase()}}_android{{\android}}\android\src\main\kotlin\{{org_name.pathCase()}}\*' (OS Error: The system cannot find the path specified.
, errno = 3)
#0      _Directory._fillWithDirectoryListing (dart:io-patch/directory_patch.dart:42:24)
#1      _Directory.listSync (dart:io/directory_impl.dart:233:5)
#2      MasonGenerator._fromBrick (package:mason/src/generator.dart:91:14)
#3      MasonGenerator.fromBundle (package:mason/src/generator.dart:70:27)
<asynchronous suspension>
#4      CreateSubCommand.run (package:very_good_cli/src/commands/create/commands/create_subcommand.dart:199:23)
<asynchronous suspension>
#5      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#6      VeryGoodCommandRunner.runCommand (package:very_good_cli/src/command_runner.dart:211:18)
<asynchronous suspension>
#7      VeryGoodCommandRunner.run (package:very_good_cli/src/command_runner.dart:148:14)
<asynchronous suspension>
#8      main (file:///C:/Users/yaswa/AppData/Local/Pub/Cache/hosted/pub.dev/very_good_cli-0.13.1/bin/very_good.dart:5:24)
<asynchronous suspension>
FINE: Pub 2.19.6
Argument information:
  Top level options:
  - verbose: true
  Command: create
    Command options:
    Command sub command: flutter_plugin
Running with analytics enabled.
Building generator from brick: very_good_flutter_plugin ^0.3.3
Building generator from brick failed: PathNotFoundException: Directory listing failed, path = 'C:\Users\yaswa\AppData\Local\Mason\Cache\hosted\registry.brickhub.dev\very_good_flutter_plugin_0.3.3\__brick__\{{project_name.snakeCase()}}\{{project_name.snakeCase()}}\example\{{#android}}android{{\android}}\app\src\main\kotlin\com\example\{{project_name.snakeCase()}}\*' (OS Error: The system cannot find the path specified.
, errno = 3)
Building generator from bundle very_good_flutter_plugin 0.3.3
Unhandled exception:
PathNotFoundException: Directory listing failed, path = 'C:\Users\yaswa\AppData\Local\Mason\Cache\bundled\very_good_flutter_plugin_0.3.3_22878f28a4fe654485c306b2b7c238e94c4ec37c\__brick__\{{project_name.snakeCase()}}\{{#android}}{{project_name.snakeCase()}}_android{{\android}}\android\src\main\kotlin\{{org_name.pathCase()}}\*' (OS Error: The system cannot find the path specified.
, errno = 3)
#0      _Directory._fillWithDirectoryListing (dart:io-patch/directory_patch.dart:42:24)
#1      _Directory.listSync (dart:io/directory_impl.dart:233:5)
#2      MasonGenerator._fromBrick (package:mason/src/generator.dart:91:14)
#3      MasonGenerator.fromBundle (package:mason/src/generator.dart:70:27)
<asynchronous suspension>
#4      CreateSubCommand.run (package:very_good_cli/src/commands/create/commands/create_subcommand.dart:199:23)
<asynchronous suspension>
#5      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#6      VeryGoodCommandRunner.runCommand (package:very_good_cli/src/command_runner.dart:211:18)
<asynchronous suspension>
#7      VeryGoodCommandRunner.run (package:very_good_cli/src/command_runner.dart:148:14)
<asynchronous suspension>
#8      main (file:///C:/Users/yaswa/AppData/Local/Pub/Cache/hosted/pub.dev/very_good_cli-0.13.1/bin/very_good.dart:5:24)
<asynchronous suspension>
IO  : Writing 584 characters to text file C:\Users\yaswa\AppData\Local\Pub\Cache\log\pub_log.txt.
MSG : Logs written to C:\Users\yaswa\AppData\Local\Pub\Cache\log\pub_log.txt.

@yahu1031
Copy link
Author

yahu1031 commented May 1, 2023

This happens with all the versions.

@alestiago
Copy link
Contributor

alestiago commented May 5, 2023

@yahu1031 thanks for opening an issue 💙 !

I've been unable to reproduce this issue in MacOS, but you seem to be using Windows. In other words, very_good create flutter_plugin sky_client succeeds for MacOS.

Do you mind sharing the output of flutter doctor -v?

@alestiago alestiago added the waiting for response Waiting for follow up label May 5, 2023
@yahu1031
Copy link
Author

yahu1031 commented May 5, 2023

Could you please check if it creates the kotlin file in Mac? I will update the rest in a mean while. @alestiago

@alestiago
Copy link
Contributor

alestiago commented May 5, 2023

Thanks @yahu1031 for the quick reply! I look forward to the update.

Regarding your question, the file here is not being generated. There is only a single file under my_plugin_android/android/src/main/ and that is the AndroidManifest.xml. Although the Kotlin file is not being generated, the Unhandled exception is not thrown on create (MacOS).

The brick does have the Kotlin file and there is no post hook, which is interesting. This should definitely be looked into 👀 .

@renancaraujo
Copy link
Contributor

Possibly related: felangel/mason#676

@erickzanardo erickzanardo self-assigned this Jun 1, 2023
@erickzanardo erickzanardo moved this from Todo to In Progress in VGV Open Source 🦄 🧙🌟 Jun 1, 2023
@erickzanardo
Copy link
Contributor

I can confirm that this is reproducible in Windows.

@erickzanardo erickzanardo moved this from In Progress to Blocked in VGV Open Source 🦄 🧙🌟 Jun 2, 2023
@yahu1031
Copy link
Author

yahu1031 commented Jun 3, 2023

@alestiago Sorry about not responding so quickly. I'm away from my Windows machine. So can't give you more info. But LMK if anything is needed and I will try providing it somehow.

@bawantha
Copy link

This is still happening in windows

@charles0122
Copy link

This is still happening in windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected p2 Important issues not at the top of the work list
Projects
Status: Backlog
Development

No branches or pull requests

7 participants