+1 vote

Hi everyone

I have made a simple Godot game and exported it for Android. The app runs fine on the phone and on the Android TV. Alas, on Android TV it will not show in the list of apps, since it is not a native Android TV app I assume.

I know there are workarounds, like sideloading or making an Android TV native apk that will launch it, but I would rather just export it properly.

Is there a way to do this from Godot? Maybe a custom template build? I have practically zero Android dev experience.

edit:
I believe what needs to be done is use the custom build.

My understanding is that I need to add this activity to the manifest

<intent-filter>
  <action android:name="android.intent.action.MAIN" />
  <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>

As described here: link

I did not chage the manifest, wanted to try building it as-is first.

This is what I have done so far:

  • I have made sure to have openjdk-8. Removed openjdk-11 completely.
  • Checked Export template Manager for the matching version of the templates (redownloaded just in case - 3.2.3.stable installed)
  • 'Project > Install Android Build Template...' - removed android dir and re-added like this
  • 'Editor>Settings>Export>Android' - since non-custom build works, I just added SDK location /home/user/Adnroid/Sdk', as mentioned in the guide.

    • 'Project>Export' - checked 'Custom Template>Use Custom Build' On

Now export project returns:

JAVA_HOME not set and no 'java' command could be found in your PATH.

Which is strange, cause java is on the path - e.g. java -version works. But fine, I just add path and then behold:

Exit Code: 1

This is where I am stuck now.

Godot version 3.2.3
in Engine by (22 points)
edited by

1 Answer

+1 vote
Best answer

The problem was with the Godot installation. The software manager installed it with flatpak. Since flatpak snadboxes the app, access to java was not possible by default. One way to resolve the issue is to allow access to the needed locations. But much simpler approach is to download the Godot binary from the Godot homepage and just run it like that.

The intution about changing the manifest is accurate, in the intent filter this is the part that needs to be replaced (for further tweaking one can consult the docs):

<category android:name="android.intent.category.LEANBACK_LAUNCHER" />

After this everything ran smoothly.

by (22 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.