Open pgdanes opened 10 months ago
This seems to be due to path variable that Godot opens with by default
Running Godot.app through Finder/Spotlight and then executing
print_debug(OS.get_environment("path"))
outputs:
/usr/bin:/bin:/usr/sbin:/sbin
Whereas, running through terminal would pick up my entire path variable, most importantly: /opt/homebrew/opt/openjdk/bin
I'm not sure whether the mac editor should be picking up the entire path? Or would be if I had installed openJDK outside of homebrew?
That's by design when running from Finder, macOS doesn't give access to shell environment stuff.
I guess there might be a way to register this in the global PATH for all applications?
But AFAIK it's a macOS intentional limitation and not a Godot bug. CC @bruvzg
But AFAIK it's a macOS intentional limitation and not a Godot bug.
It is a macOS limitation, apps ignore all shell environment variables, there's no way to change it globally. But an app can change its environment itself. So I guess we can add common paths like hombrew and macports to the PATH or add an editor setting to do it manually (trying to parse shell configs is probably gonna be overkill).
Whereas, running through terminal would pick up my entire path variable, most importantly: /opt/homebrew/opt/openjdk/bin
Usually, JDK on macOS should be installed in /Library/Java/JavaVirtualMachines
and operate via /usr/bin/java
wrapper, so it's not dependent on PATH. I guess in this particular case, it's probably an issue with incomplete JDK install.
Whereas, running through terminal would pick up my entire path variable, most importantly: /opt/homebrew/opt/openjdk/bin
Usually, JDK on macOS should be installed in
/Library/Java/JavaVirtualMachines
and operate via/usr/bin/java
wrapper, so it's not dependent on PATH. I guess in this particular case, it's probably an issue with incomplete JDK install.
Yeah this seems the case, reinstalling through brew outputs this line as help afterwards:
For the system Java wrappers to find this JDK, symlink it with
sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
Ran the command provided by homebrew and retested Godot.app opened from Finder and it exports fine.
It might still be worth adding homebrew/other package manager paths in the editors environment? Or expanding on the error from apksigner (if it even reports any more info)?
@manake did you install the JDK correctly via .msi file? I might try it on Windows 10 later for comparison.
https://docs.godotengine.org/en/latest/tutorials/export/exporting_for_android.html https://adoptium.net/de/temurin/releases/?variant=openjdk11&os=windows
for macOS there is a solution if you do not install it as described in the doc. This is badly comparable with Windows.
For the system Java wrappers to find this JDK, symlink it with
sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
Please don't derail the discussion on whether this feature is needed or not. We need to fix the issue regardless, or improve the documentation.
same error on my nixos either maybe i do something wrong idk
Godot version
v4.1.1.stable.official [bd6af8e0e]
System information
Godot v4.1.1.stable - macOS 13.5.0 - Vulkan (Compatibility) - Apple M2 - Apple M2 (8 Threads)
Issue description
Exporting android project fails to sign using apksigner when running godot from applications folder via Godot.app
All located 'apksigner' tools in /Users/pdanes/Library/Android/sdk/build-tools failed to execute
However, when running godot executable from terminal via
/Applications/Godot.app/Contents/MacOS/Godot
oropen Godot.app
it succeeds.Steps to reproduce
Using Application directory Godot.app
Output:
Above also happens when using One Click Deploy
Using the terminal 1.a.Run godot from terminal by opening
/Applications/Godot.app/Contents/MacOS/Godot
1.b. Run godot from terminal by runningopen /Applications/Godot.app
Output:
Minimal reproduction project
N/A
I tested with a blank project setup to the bare minimum of requirements to export to android and have the same issue.