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

Android build issue - access to logs #80873

Closed
BastiaanOlij opened this issue Aug 22, 2023 · 5 comments · Fixed by #84779
Closed

Android build issue - access to logs #80873

BastiaanOlij opened this issue Aug 22, 2023 · 5 comments · Fixed by #84779

Comments

@BastiaanOlij
Copy link
Contributor

BastiaanOlij commented Aug 22, 2023

Godot version

4.2 master 8e0346b

System information

Android - Windows editor

Issue description

The root cause may be an issue with building the XR loader plugin (https://github.com/godotvr/godot_openxr_loaders) but it highlights a usability problem when diagnosing Android export issues.

Exporting gives this cryptic error:
image

Checking the log in the IDE gives us:
image

The error given here, "cannot remove non-existent file or directory..." is a dud, this is just a result of the export failing.
The real issue happens during the gradlew build and as the first error states "check output for the error", however Godot has closed the gradlew build window and there doesn't seem any (obvious) place to access this.

We need to either keep this window open on error and only close it on success, or we need to provide access to the last log somehow.

I ended up rerunning gradlew from the command line which gives me:

> Task :compileDebugJavaWithJavac FAILED
C:\Projects\godot-assets\godot_openxr_loaders\demo\android\build\src\com\godot\game\GodotApp.java:33: error: package org.godotengine.godot does not exist
import org.godotengine.godot.GodotActivity;
                            ^
C:\Projects\godot-assets\godot_openxr_loaders\demo\android\build\src\com\godot\game\GodotApp.java:41: error: cannot find symbol
public class GodotApp extends GodotActivity {
                              ^
  symbol: class GodotActivity
C:\Projects\godot-assets\godot_openxr_loaders\demo\android\build\src\com\godot\game\GodotApp.java:42: error: method does not override or implement a method from a supertype
        @Override
        ^
C:\Projects\godot-assets\godot_openxr_loaders\demo\android\build\src\com\godot\game\GodotApp.java:44: error: cannot find symbol
                setTheme(R.style.GodotAppMainTheme);
                ^
  symbol:   method setTheme(int)
  location: class GodotApp
C:\Projects\godot-assets\godot_openxr_loaders\demo\android\build\src\com\godot\game\GodotApp.java:45: error: cannot find symbol
                super.onCreate(savedInstanceState);
                ^
  symbol:   variable super
  location: class GodotApp
5 errors

These errors suggest an issue with the loader plugin configuration though I don't rule out an issue in the export on Godot itself.

Steps to reproduce

  • clone https://github.com/godotvr/godot_openxr_loaders
  • build godot_openxr_loaders by executing ./gradlew.bat build on the command line
  • open up the demo project in this repo using Godot master
  • install the android template
  • run Export Project for the Android preset in this project (you don't need a headset to test the export)

Minimal reproduction project

https://github.com/godotvr/godot_openxr_loaders

@BastiaanOlij
Copy link
Contributor Author

cc @m4gr3d

@BastiaanOlij
Copy link
Contributor Author

The build issue itself has been resolved, I managed to include devbuild=yes into my scons command as I had to re-setup vscode and managed to copy that from the editor build.

This meant the builds weren't included properly in the android_source.zip and things fell apart from there.

The original issue remains however that when a scenario like this happens, access to the logs that would help in diagnosing the issue isn't available. Changing the interface so the gradlew build log is not closed on failure would help heaps.

@bruvzg
Copy link
Member

bruvzg commented Aug 29, 2023

We need to either keep this window open on error and only close it on success

It should be already done, but seems like window hierarchy is structured in a such way (gradlew output window probably is child of process dialog) that case all the child windows to be closed when parent window is.

@trysenga
Copy link

trysenga commented Oct 2, 2023

Having issues with this as well. Build fails, who knows why. The logs either need to be captured to a file or the window needs to remain open.

@dibely
Copy link

dibely commented Oct 14, 2023

+1 for somehow keeping the gradle build log window open or piping this info into the editor console log if possible to help with determining the real cause for why an Android build fails without having to manually build the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants