klutter-dart icon indicating copy to clipboard operation
klutter-dart copied to clipboard

lib not found

Open DjToMeK30 opened this issue 2 years ago • 5 comments

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. (dart:isolate-patch/isolate_patch.dart:295:32) #8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12) pub finished with exit code 255`

DjToMeK30 avatar Nov 02 '22 18:11 DjToMeK30

What OS do you work on? I see flutter windows in the log so I presume you're using windows?

buijs-dev avatar Nov 03 '22 11:11 buijs-dev

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"

DjToMeK30 avatar Nov 03 '22 12:11 DjToMeK30

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 ).

buijs-dev avatar Nov 03 '22 13:11 buijs-dev

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

DjToMeK30 avatar Nov 03 '22 13:11 DjToMeK30

Yes please try on a mac and let me know! Thank you. :)

buijs-dev avatar Nov 03 '22 18:11 buijs-dev

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.

charliebudd avatar May 03 '23 20:05 charliebudd

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).

buijs-dev avatar May 04 '23 16:05 buijs-dev

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

charliebudd avatar May 04 '23 20:05 charliebudd

Ah good find! Maybe it's enough to replace every forward slash with Platform.sep in that code. I'll have a look tomorrow.

buijs-dev avatar May 04 '23 20:05 buijs-dev

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

charliebudd avatar May 04 '23 21:05 charliebudd

I'm looking into this for next release.

buijs-dev avatar Oct 05 '23 19:10 buijs-dev

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.

buijs-dev avatar Oct 12 '23 22:10 buijs-dev