klutter-dart
klutter-dart copied to clipboard
lib not found
I tried everything in https://buijs.dev/klutter-2/ for setting up my project but I get an error on latest flutter/dart
when running
flutter pub run klutter:producer init
I tried alot of stuff but the problem remains the same
` ════════════════════════════════════════════ KLUTTER (v0.2.4) ════════════════════════════════════════════
This might take a while. Just a moment please...
Unhandled exception:
FileSystemException: Exists failed, path = '\D:\flutter\test_klutter\lib' (OS Error: The filename, directory name, or volume label syntax is incorrect.
, errno = 123)
#0 _Directory.existsSync (dart:io/directory_impl.dart:94:7)
#1 FileUtil.maybeDelete (package:klutter/src/common/utilities.dart:60:9)
#2 _extension#0.setupRoot (package:klutter/src/cli/task_producer_init.dart:53:27)
#3 ProducerInit.toBeExecuted (package:klutter/src/cli/task_producer_init.dart:41:7)
#4 Task.execute (package:klutter/src/cli/task.dart:52:7)
#5 execute (package:klutter/src/cli/cli.dart:107:27)
#6 main (file:///D:/flutter/flutter_windows_3.3.6-stable/flutter/.pub-cache/hosted/pub.dartlang.org/klutter-0.2.4/bin/producer.dart:40:24)
#7 _delayEntrypointInvocation.
What OS do you work on? I see flutter windows in the log so I presume you're using windows?
Yes, windows I just started Flutter development last week. Yesterday it asked me to update Flutter, so I did Then I tried your example and this happens.
Lib folder is there and working. Tried also running with Admin(cmd), and checked that I ran pub get in both example and parent folder but this always happens on running with that command
Edit: I don't know if that had any difference, but first I created a project and added klutter v0.2.3 and ran pub get. Then I just changes in .yaml file to v0.2.4 and ran pub get again. I did that before running "pub run klutter:producer init"
That should not make a difference. I have not tested Klutter on windows myself because you won't be able to do the iOS development on windows. I will see if I reproduce this issue later today but I think it's as simple as an invalid windows path (e.g. / VS ).
Oh ok thank you. I just wanted to try Android side on Windows to see if it is viable option and to test Android code and later try on MAC for iOS Side I can also try on some other MAC machine when I get to it
Yes please try on a mac and let me know! Thank you. :)
Seeing the same thing, I had assumed it was a windows issue from the path displayed in the error message. I think windows support would be a nice addition. Even if most people would use a mac to build and publish for IOS many people do there development in windows/linux.
Okay noted. If there's enough interest I can look into it. For now I'm focussing on the 2023 beta release and I'm not sure how much time I will have beyond that (this year).
I may be able to find some time to help get it working on windows. In fact it seams the main issue here is that the _substitute
method assumes the platform of the user and forces paths to begin with a /
. I can open a PR adding a platform check here if you want to review it.
https://github.com/buijs-dev/klutter-dart/blob/46d3dc0c17140e6743cdb63f01fb2deb09bb4524/lib/src/common/utilities.dart#L99-L101
Ah good find! Maybe it's enough to replace every forward slash with Platform.sep in that code. I'll have a look tomorrow.
Got the producer init command to run successfully but it isn't pretty...
changes can be seen here https://github.com/charliebudd/klutter/tree/windows-support
I'm looking into this for next release.
The dart side is done (1.0.0). There's work to be done in the Gradle Plugin e.a. because using global flutter on windows does not work well. It will be fixed by this issue where I'm working on right now.