-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 Android export failing with custom keystores and no JDK setup in the OS environment #94809
Fix Android export failing with custom keystores and no JDK setup in the OS environment #94809
Conversation
Please open a dedicated bug report to track this properly |
Related issue: #94815 |
@@ -2340,6 +2340,7 @@ static bool has_valid_keystore_credentials(String &r_error_str, const String &p_ | |||
} | |||
|
|||
bool EditorExportPlatformAndroid::has_valid_username_and_password(const Ref<EditorExportPreset> &p_preset, String &r_error) { | |||
String keytool = get_keytool_path(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use get_keytool_path()
directly in has_valid_keystore_credentials
instead of passing it as an argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not without changing the signature of has_valid_keystore_credentials()
which currently is static, so no access to the member function get_keytool_path()
is given.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_keytool_path()
is also static
but the issue seems to be because has_valid_keystore_credentials
is not declared in the header file. Adding that declaration should resolve the access issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed get_keytool_path()
beeing static
. There's not even a need for declaring has_valid_keystore_credentials
in the header file. Calling EditorExportPlatformAndroid::get_keytool_path()
(added class specifier) is sufficient.
I will amend the pull request accordingly.
…nt and custom keystores have been set in the export dialog.
d4912ed
to
7afefe6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the fix!
It is a pleasure to support such a great project! |
Thanks! And congrats for your first merged Godot contribution 🎉 |
Test environment
Godot Engine v4.3.rc1.official
Windows 11 Pro, Version 23H2, Build 22631.3880
Issue
Export for Android fails on Windows if there is no path to a JDK set in the PATH environment variable and debug and/or release keystores have been set in the options dialg of the export window.
This issue should also affect other operating systems but i have only tested in windows.
The error message printed in the console looks like this:
Fix
The reason for this is that the static function has_valid_keystore_credentials in
platform/android/export/export_plugin.cpp
runs the hardcoded "keytool" command instead of using get_keytool_path to get the correct path that uses theexport/android/java_sdk_path
setting.The proposed fix replaces all occurrences of the hardcoded "keytool" with a string returned by get_keytool_path.