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

%1 is not a valid win32 application #3108

Open
LyuDeveloper opened this issue Dec 15, 2024 · 3 comments
Open

%1 is not a valid win32 application #3108

LyuDeveloper opened this issue Dec 15, 2024 · 3 comments
Labels
good first issue A good starting issue for contributors (issues with this label will appear in /contribute) type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@LyuDeveloper
Copy link

What happened?

I tried to run dartpad locally. But when I run dart bin/server.dart ,it printed %1 is not a valid win32 application.
I have tried on two Windows PCs. But they have the same result.
There is not any spaces in my path.

Steps to reproduce problem

Additional info

Machine

Operating system: Microsoft Windows 10 & 11 x64

Version: Dart SDK version: 3.6.0 (stable) (Thu Dec 5 07:46:24 2024 -0800) on "windows_x64"

Your code

What code was in the editor, if any, when the failure occurred? You
can paste it in below:

I didn't run dartpad successfully.

DartPad's output

Did DartPad print anything to the console pane? If so, paste it below:

PS D:\dart-pad-main\pkgs\dart_services> dart bin/server.dart
warning: no redis server specified.

Unhandled exception:
ProcessException: %1 不是有效的 Win32 应用程序。

  Command: D:\FlutterSDK\bin\flutter --version --machine
#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      Sdk._retrieveFlutterVersion (package:dart_services/src/sdk.dart:125:33)
#4      new Sdk.fromLocalFlutter (package:dart_services/src/sdk.dart:91:22)
#5      main (package:dart_services/server.dart:44:19)
#6      main (file:///D:/dart-pad-main/pkgs/dart_services/bin/server.dart:9:54)
#7      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:33)
#8      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

%1 不是有效的 Win32 应用程序。 means %1 is not a valid win32 application in English.

@devoncarew devoncarew added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) good first issue A good starting issue for contributors (issues with this label will appear in /contribute) labels Dec 16, 2024
@devoncarew
Copy link
Member

Thanks for the report! We don't develop (or deploy) the dartpad server on windows; there could be legitimate issues here wrt our path handling.

We won't have time to investigate this ourselves but are happy to take PRs in this area.

@Levi-Lesches
Copy link
Contributor

Levi-Lesches commented Dec 17, 2024

I just came across this the other day. The solution (at least on windows) is to add runInShell: true to Process.run() call that fails (check the stack trace, it's sdk.dart:125:33)

I'm not knowledgeable enough about that flag to determine if it's safe to add on Linux platforms

@LyuDeveloper
Copy link
Author

Thank you for reply! Now I have edited the source code and raun server successfully.
Although I am still in the trouble of "Route not found.

I've added a judgment for the OS platform, which comes with runInShell: true, when running on windows.
After Route not found is resolved, I will test and prepare a request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good starting issue for contributors (issues with this label will appear in /contribute) type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants