bdero / flutter_scene

3D library for Flutter.
MIT License
134 stars 9 forks source link

Cannot run importer #34

Open LeoCrenon opened 4 hours ago

LeoCrenon commented 4 hours ago

Hello, i'm trying to run the importer on different glb files (including the example DamagedHelmet) but i get this error everytime :

ProcessException: No such file or directory

  Command: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug
#0      _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:488:7)
#1      _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:633:18)
#2      Process.runSync (dart:io-patch/process_patch.dart:68:12)
#3      main.<anonymous closure> (file:///PATH/appdata/local/pub/cache/hosted/pub.dev/flutter_scene_importer-0.1.2-3/hook/build.dart:26:36)
#4      build (package:native_assets_cli/src/api/build.dart:92:16)
#5      main (file:///PATH/appdata/local/pub/cache/hosted/pub.dev/flutter_scene_importer-0.1.2-3/hook/build.dart:7:9)
#6      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:33)
#7      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
Building native assets for package:flutter_scene_importer failed.
file:///PATH/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_scene_importer-0.1.2-3/hook/build.dart returned with exit code: 255.
To reproduce run:
C:\PATH\Documents\flutter\bin\cache\dart-sdk\bin\dart.exe '--packages=C:\PATH\.dart_tool\package_config.json' 'C:\PATH\.dart_tool\native_assets_builder\a63996ef2018865896090302e099b2bf\hook.dill' '--config=C:\PATH\.dart_tool\native_assets_builder\a63996ef2018865896090302e099b2bf\config.json'

I tried on Windows, WSL and macOS and encounter the same issue.

My flutter doctor and dart version

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 3.27.0-1.0.pre.105, on Microsoft Windows [version 10.0.22631.4317], locale fr-FR)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Professional 2022 17.5.2)
[!] Android Studio (version 2022.1)
    X Unable to determine bundled Java version.
[√] Android Studio (version 2024.1)
[√] VS Code (version 1.94.2)
[√] Connected device (3 available)
[√] Network resources

! Doctor found issues in 1 category.

Dart SDK version: 3.7.0-34.0.dev (dev) (Wed Oct 16 21:01:59 2024 -0700) on "windows_x64"

Thanks for your help

kwill39 commented 3 hours ago

Hey @LeoCrenon , have you tried following the guide here?

If so, are you trying to use the importer manually via the command line or are you trying to use it automatically via a build hook?

LeoCrenon commented 2 hours ago

Yes i followed this guide, and i was trying to use it via the command line

kwill39 commented 1 hour ago

Okay, and if you ran this command:

dart --enable-experiment=native-assets \ run flutter_scene_importer:import \ --input "path/to/my/source_model.glb" \ --output "path/to/my/imported_model.model"

Then it would seem the issue is with your input argument. Have you tried specifying an absolute path instead of a relative path?

If you can, please provide the exact command that you're running. Feel free to redact any personal information in the directory path, such as your name.

LeoCrenon commented 1 hour ago

I tried using absolute path on Windows and macOs with nothing new

PS C:\test_3d> pwd

Path
----
C:\test_3d

PS C:\test_3d> dart --enable-experiment=native-assets run flutter_scene_importer:import --input "C:/test_3d/assets/DamagedHelmet.glb" --output "C:/test_3d/assets/DamagedHelmet.model"

Unhandled exception:
ProcessException: No such file or directory

Command: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug
#0      _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:488:7)
#1      _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:633:18)
#2      Process.runSync (dart:io-patch/process_patch.dart:68:12)
#3      main.<anonymous closure> (file:///c:/users/leocr/appdata/local/pub/cache/hosted/pub.dev/flutter_scene_importer-0.2.0-0/hook/build.dart:26:36)
#4      build (package:native_assets_cli/src/api/build.dart:93:16)
#5      main (file:///c:/users/leocr/appdata/local/pub/cache/hosted/pub.dev/flutter_scene_importer-0.2.0-0/hook/build.dart:7:9)
#6      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:33)
#7      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
Building native assets for package:flutter_scene_importer failed.
file:///C:/Users/leocr/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_scene_importer-0.2.0-0/hook/build.dart returned with exit code: 255.
To reproduce run:
C:\Users\leocr\Documents\flutter\bin\cache\dart-sdk\bin\dart.exe --packages=C:\test_3d\.dart_tool\package_config.json C:\test_3d\.dart_tool\native_assets_builder\a63996ef2018865896090302e099b2bf\hook.dill --config=C:\test_3d\.dart_tool\native_assets_builder\a63996ef2018865896090302e099b2bf\config.json

And if i reproduce it using the "to reproduce run ... command":

PS C:\test_3d> C:\Users\leocr\Documents\flutter\bin\cache\dart-sdk\bin\dart.exe --packages=C:\test_3d\.dart_tool\package_config.json C:\test_3d\.dart_tool\native_assets_builder\a63996ef2018865896090302e099b2bf\hook.dill --config=C:\test_3d\.dart_tool\native_assets_builder\a63996ef2018865896090302e099b2bf\config.json
Running cmake gen step...
Unhandled exception:
ProcessException: Le fichier spécifié est introuvable.

  Command: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug
#0      _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:488:7)
#1      _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:633:18)
#2      Process.runSync (dart:io-patch/process_patch.dart:68:12)
#3      main.<anonymous closure> (file:///c:/users/leocr/appdata/local/pub/cache/hosted/pub.dev/flutter_scene_importer-0.2.0-0/hook/build.dart:26:36)
#4      build (package:native_assets_cli/src/api/build.dart:93:16)
#5      main (file:///c:/users/leocr/appdata/local/pub/cache/hosted/pub.dev/flutter_scene_importer-0.2.0-0/hook/build.dart:7:9)
#6      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:33)
#7      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
kwill39 commented 1 hour ago

Not sure if it will make a difference, but it looks like you're using forward slashes "/" in your path for separators whereas Windows uses backslashes "\"

LeoCrenon commented 1 hour ago

i tried it too : dart --enable-experiment=native-assets run flutter_scene_importer:import --input "C:\test_3d\assets\DamagedHelmet.glb" --output "C:\test_3d\assets\DamagedHelmet.model"

kwill39 commented 55 minutes ago

Okay. Have you installed CMAKE? I remember I had to do that when I followed the guide myself the first time.

LeoCrenon commented 37 minutes ago

Thank you ! It was the solution

kwill39 commented 33 minutes ago

Awesome! Feel free to close the issue if you're all set.