0 votes

Hello,

I'm actually trying to make a login screen that work perfectly on pc but when I export to my android device the button that should change the scene doesn't work.

func _on_LoginButton_pressed():
    get_tree().change_scene("res://interface/login/Login.tscn")

I get some errors like:

Method/Function Failed, returning: ERRPARSEERROR

and some about failing to load ressources like my tscn files or gdc.

Using the load function (the code just below) doesn't fix my problem, when I click the button with this code it make the main scene to disapear (that's normal) but there is no scene to take his place so I just have a grey screen without my buttons.

var loginScene = load("res://interface/login/Login.tscn")

func _on_LoginButton_pressed():
    get_tree().change_scene_to(loginScene)

I'm a begginer in godot so it may be a simple mistake from me.

Every help would be appreciated a lot.

EDIT: I found why I got the erros that's because I'm using the mysql modules (this one https://github.com/Malkverbena/MySQL_Module)
I don't know why but on my phone it make the scene doesn't load.
Maybe i need to give some other permission than the "internet" one.

in Engine by (12 points)
edited by

You could actually build an android export template with the MySQL Module?

Did you install a MySQL Connector on Android?
( Google told me this one: https://github.com/BoardiesITSolutions/Android-MySQL-Connector )

And I hope that you connect to MySQL only in LAN / VPN. Opening a MySQL Server over the internet generally isn't recommended.

Perhaps using HTTP-Requests + JSON + some serverside code (PHP or whatever) is easier than directly interfacing to MySQL

Did you find any solutions for the problem? I am now facing the same issue. Main level loads fine, but then upon pressing start button it doesn't load the first Level scene. It kicks me outta game. PC version works perfectly well, but Android release has the above mentioned problems.

1 Answer

0 votes

My guess is that you didn't use the exact file name when loading the scene.
Android (and linux) is case-sensitive whereas windows doesn't care.

So check the exact case & writing of your paths in the gdscript. Maybe the file is actually "login.tscn" instead of "Login.tscn" or the directory is called "/Login/" instead of "/login/".

See also here: ("drawbacks")
https://docs.godotengine.org/en/3.1/getting_started/step_by_step/filesystem.html

by (3,280 points)

All path are good.
But thx for the proposal.

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.