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

"whichSync" returns null after build #79

Open
DjordjeMancic97 opened this issue Oct 26, 2022 · 4 comments
Open

"whichSync" returns null after build #79

DjordjeMancic97 opened this issue Oct 26, 2022 · 4 comments

Comments

@DjordjeMancic97
Copy link

I would like to access flutter executable through my app which uses this plugin. It all works well and flutter executable is found in debug mode, even when I run it with "--release" flag but when I do "flutter build macos" and after that create ".dmg" file from it, "whichSync" can no longer find flutter executable. Sandbox mode is off

@alextekartik
Copy link
Contributor

Between debug and release mode, your PATH variable is different. What is likely happening is that flutter is not in your global path. What you can try:

  • add flutter bin directory in your PATH before running the release version
  • print the env PATH variable from within you executable to check whether flutter bin folder is indeed in you PATH

@DjordjeMancic97
Copy link
Author

DjordjeMancic97 commented Oct 27, 2022

Hi thank for fast response. If I do "echo $PATH" I can see Flutter in my path.. And as I said it works both in debug mode and release mode, only after I build the app and convert it to ".dmg" file after I run it, its not finding Flutter anymore..

What I tried is also allowing user to select their Flutter folder and like that I get the path but I cannot execute Flutter from it, cause of permission issue... I wouldn't like to implement some solution which requires a lot of configuration from user's side in order for app to work.

Wondering if I could somehow extract Flutter executable along with "symbolize" command which can be found in "flutter_tools" and store them locally inside the project. As this app only needs to run "flutter symbolize" command to deobfuscate some stracktrace... However I looked into Flutter repo and to me it seems impossible to get only the flutter executable as it depends on a lot of other stuff...

You actually can see the project I am talking about here on my Github, it's called "Stacktracer"

@alextekartik
Copy link
Contributor

If I do "echo $PATH" I can see Flutter in my path.

I guess that when you run this, you are in the terminal app, correct?, which loads additional resource file that are not loaded from GUI app. The PATH in your console is different than the one running from the UI. I'm not too familiar with MacOS, but likely your flutter env is set in ~/.zshrc or ~/.profile or other "console only" resource file. For "UI" app, there are solutions that I don't fully understand yet: https://discussions.apple.com/thread/253877043

(I might be completely wrong in what I say, I don't have the experience of global PATH and environment variable on MacOS)

@jasonJamEther
Copy link

@DjordjeMancic97 did you ever find a solution to this? I am facing the same problem.

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

3 participants