Error when loading scenes on android device

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By manfredhq

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: ERR_PARSE_ERROR

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 GitHub - Malkverbena/mysql: MySQL connector to Godot Engine.)
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.

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: GitHub - BoardiesITSolutions/Android-MySQL-Connector: Native MySQL Connector for Android )

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

wombatstampede | 2019-12-04 12:30

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.

Suleymanov | 2020-11-15 09:14

:bust_in_silhouette: Reply From: wombatstampede

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”)

All path are good.
But thx for the proposal.

manfredhq | 2019-12-04 12:04