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

Display Gradle's standard output/error to the console when exporting to Android #2559

Closed
myood opened this issue Apr 6, 2021 · 2 comments
Closed

Comments

@myood
Copy link

myood commented Apr 6, 2021

Describe the project you are working on

Mobile android game

Describe the problem or limitation you are having in your project

When using headless godot and exporting from command line, when gradle compilation fails, then there is not output from gradle (no gradle error):

godot --verbose --debug --export-debug "Android Debug" debug.aab
# Lots of output skipped...
Build Android project using gradle command: 
/builds/myoodster/dungeon-puzzle/android/build/gradlew clean bundleDebug -p /builds/myoodster/dungeon-puzzle/android/build -Pexport_package_name=com.zywegry.dungeonsweepermatch3 -Pexport_version_code=11111 -Pexport_version_name=0.1 -Pexport_enabled_abis=x86 -Pplugins_local_binaries=/builds/myoodster/dungeon-puzzle/android/plugins/GodotPlayStoreReview.release.aar|/builds/myoodster/dungeon-puzzle/android/plugins/GodotShare.release.aar|/builds/myoodster/dungeon-puzzle/android/plugins/GodotPlayGamesServices.release.aar -Pplugins_remote_binaries=com.google.android.play:core:1.8.0|com.google.android.play:core:1.8.0|com.google.android.gms:play-services-games:20.0.1|com.google.android.gms:play-services-auth:18.1.0|com.google.code.gson:gson:2.8.6 -Pplugins_maven_repos= -Pperform_zipalign=true -Pperform_signing=true -Pgodot_editor_version=3.3.rc7
Found Android plugin GodotPlayStoreReview
Found Android plugin GodotShare
Found Android plugin GodotPlayGamesServices
Thread exit status: 1
export: end
reimport: end
EditorSettings: Save OK!

While exporting from GUI (the "normal" Godot Editor), in case gradle fails, the new window with gradle output is displayed to the user:

> Task :processDebugManifest FAILED
G:\Godot\dungeon-puzzle\android\build\src\debug\AndroidManifest.xml Error:
	uses-sdk:minSdkVersion 18 cannot be smaller than version 21 declared in library [GodotPlayStoreReview.release.aar] C:\Users\myood\.gradle\caches\transforms-2\files-2.1\727ac6ffe3ea2384f84e0b3303d4e329\jetified-GodotPlayStoreReview.release\AndroidManifest.xml as the library might be using APIs not available in 18
	Suggestion: use a compatible library with a minSdk of at most 18,
		or increase this project's minSdk version to at least 21,
		or use tools:overrideLibrary="com.zywegry.godotplaystorereviewplugin" to force usage (may lead to runtime failures)

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Redirect the error log present in the GUI version to the console standard output when invoking from commandline.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I guess there's additional redirect to console needed in int EditorNode::execute_and_show_output(const String &p_title, const String &p_path, const List<String> &p_arguments, bool p_close_on_ok, bool p_close_on_errors) {. It seems trivial, but I don't know godot source code that much to be sure.
I created a PR godotengine/godot#47695 to show the intent and possible implementation.
In the PR I used print_verbose() function, which should print only if "--verbose" flag is set, right?

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

This is essential for debugging CI issues

@Calinou Calinou changed the title Android Export / Display gradle output to the commandline Display Gradle's standard output/error to the console when exporting to Android Apr 6, 2021
@Calinou
Copy link
Member

Calinou commented Mar 18, 2022

In the PR I used print_verbose() function, which should print only if "--verbose" flag is set, right?

This is indeed the case 🙂

I wonder if print_line() is more suited here. Execution errors should not be hidden behind a verbose flag.

@Calinou
Copy link
Member

Calinou commented Jun 24, 2024

For future reference, this was implemented in 4.2 by godotengine/godot#84779.

@Calinou Calinou added this to the 4.2 milestone Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants