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

Fix apksigner execution failure on linux #102171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions platform/android/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2431,6 +2431,20 @@ String EditorExportPlatformAndroid::get_apksigner_path(int p_target_sdk, bool p_
String java_sdk_path = EDITOR_GET("export/android/java_sdk_path");
if (!java_sdk_path.is_empty()) {
OS::get_singleton()->set_environment("JAVA_HOME", java_sdk_path);

#ifdef UNIX_ENABLED
// Check for the `java` command.
String java_path = get_java_path();
if (!FileAccess::exists(java_path)) {
print_error("Unable to find 'java' command using the Java SDK path specified in Editor Settings.");
return "<FAILED>";
} else {
String env_path = OS::get_singleton()->get_environment("PATH");
if (!env_path.contains(java_sdk_path)) {
OS::get_singleton()->set_environment("PATH", java_sdk_path + "/bin:" + env_path);
}
}
#endif
}

List<String> args;
Expand Down