Fix Android export failing with custom keystores and no JDK setup in the OS environment #94809
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.