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

Failed to run app seperately #26

Open
aroxu opened this issue Oct 13, 2020 · 10 comments
Open

Failed to run app seperately #26

aroxu opened this issue Oct 13, 2020 · 10 comments

Comments

@aroxu
Copy link

aroxu commented Oct 13, 2020

When build app with flutter on macOS and run by double-clicking app, when Process.run ran, it instantly die.
source: https://github.com/aroxu/Youtility/blob/main/lib/main.dart#L67-L84

Screen Record: https://drive.google.com/file/d/1lSDVRXkH_zOymNiL7ED3JV1DxfuOF1ug/view?usp=sharing
Built App :
Release.zip

@alextekartik
Copy link
Contributor

MacOS requires some xcode setting to allow spawning binaries. This could be the issue

@alextekartik
Copy link
Contributor

In macos/Runner/DebugProfile.entitlements and macos/Runner/Release.entitlements, change:

<dict>
	<key>com.apple.security.app-sandbox</key>
	<true/>
</dict>

to

<dict>
	<key>com.apple.security.app-sandbox</key>
	<false/>
</dict>

@aroxu
Copy link
Author

aroxu commented Oct 13, 2020

com.apple.security.app-sandbox

Not Worked. :[

@qinkaiabc
Copy link

Not Worked.

@alextekartik
Copy link
Contributor

Hard to say what is not working without seeing any logs, stacktrace, exception (try to catch exception and prints the result).
You could try to use dart io implementation (https://api.dart.dev/stable/2.10.2/dart-io/Process/run.html) on which the implementation is based.

@qinkaiabc
Copy link

1.% flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, 1.23.0-18.0.pre, on Mac OS X 10.15.6 19G73 x86_64, locale zh-Hans-CN)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Android Studio
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.49.3)
[✓] Connected device (1 available)

• No issues found!

2.process_run: ^0.11.0+2

3.And then run 'flutter build macos'

4.When build app with flutter on macOS and run by double-clicking app, when Process.run ran, it instantly die even
catch exception.

@qinkaiabc
Copy link

5.when I init var shell = shell = Shell(stdout: _stdoutCtlr.sink, stderr: _stderrCtlr.sink, runInShell: true);
6.then click

onTap: () {
       shell.run('dart --version');
}

the result is

$ dart --version
/bin/sh: dart: command not found

@alextekartik
Copy link
Contributor

I'm not sure why you use runInShell: true. Have you tried without? You could also try to add the dart binary path to your global environment variable.

@aroxu
Copy link
Author

aroxu commented Oct 21, 2020

It just same.
@alextekartik Can you clone my repo and try?

@szpnygo
Copy link

szpnygo commented Feb 5, 2022

@alextekartik how to solve ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants