Trouble to export

4.5

Hi there!

I had finished my project in Godot for Android, but when I exported it, the game didn’t work as it should. Some labels wouldn’t load and the buttons weren’t working. The only things that worked were the animations, sounds, and the transition to another scene. I made sure the SDK was compatible with my device (my Android is 10, the project’s SDK was 24-35).I put in both advanced and less advanced architecture.I made sure there were absolutely no errors or warnings in the engine.I made sure that all files were being exported and that the permissions were being requested correctly.

To test this, I noticed that the buttons still had their names in the viewfinder, even though the script loads them automatically. I removed all the names. When I exported again, absolutely no text appeared.

The strangest thing is that the project is running correctly in the editor.

Did you use TouchScreenButtons or just regular ones?

1 Like

Read what complaints the engine puts out in the logs.

1 Like

To quote from the original post:

“I made sure there were absolutely no errors or warnings in the engine.”

I think they already made sure of that.

1 Like

What would this type of button be?

Would it be something like “input event is touchscreenevent”?

For some reason, the output printed 15 times the error

ERROR: scene/3d/node_3d.cpp:621 - Condition “!is_inside_tree()” is true. Returning: Transform3D(

)

What could this mean?

This means the get_global_transform is being called for a node that is not added to the tree of nodes and thus has no global position. It returns an empty transform instead of an actual one. I don’t know if this is necessarily related to the problems you are seeing but it’s a lead.

1 Like

Interesting….

Well, how could I fix this? If this error was shown 15 times, does that mean there are 15 nodes with some hidden problem? How could I tell which node is faulty?

It might be one place called fifteen times. If the log gives no further clues you just have to look through all the places in the scripts where the get_global_transform or global_transform is used. Make sure the nodes it is applied to would be in the tree at the time. Or add print() here and there to have the code report what it does to the log.

they are different nodes

Ok

I found out where the error was coming from.

It came from the “move_and_slide()” function, which indirectly references global_transform.

I fixed the problem with a simple "if is_inside_tree()”

The errors in the output disappeared, but the project remains strange.

Do you know if there are any Android implications or anything like that related to nodes or the GDScript language?

The stuff inside the engine should be entirely platform independent, that’s the idea. I’d guess the export is ok if it runs and there is no errors in the log.

Best bet is to follow the actual flaws. Put the print()s around where you said your buttons isn’t working, see what part of the code is doing not what you expect. Are they not pressed at all or is the code they shoud run fails at some point, stuff like that. Also, maybe you can run on android straight from the editor, although I had problems with that last I tried.

Also, here’s a video of the problem

The most strange is the fact there’s nothing wrong when I run the script.

Also, what could I print?

Ah you are editing on android. Not sure how to see the log from the game in that case, but chances are there are some error messages there you aren’t seeing.

The only thing wrong in the video is the texts are invisible. This might just be a missing or damaged font. Open the exported apk and check if the font is actually there. Or you could switch to defaut font and see if that changes anything.

Yeah, it seems the problem is something related to the texts. And the font is in the APK. Also, I already tried to use the regular font, but there was the same trouble…

This one is not the font file. The .import file is where Godot keeps its settings related to the resource. There also should be the ArchitectsDaughter.ttf itself somewhere. The one from Gogle Fonts weights around 37kb .

You should totally be looking for a way to get the logs from the exported game, like logging - Android: Get Log without PC-Connection - Stack Overflow. Get your workflow right for the future. Figuring out a resource is missing isn’t supposed to be this hard.

Apparently the problem isn’t with loading the font into the project, since the only text that appears uses the font, such as the bugged placeholder and the title.

It seems the problem arises when the text is inserted via code.

I solved the problem.

Explication:

I noticed that the scripts were running strangely, so I did a manual debug test.

I added a color rectifier and created several if conditions, and with each successful transaction, the color rectifier changed color.

Like this:

If %text != Null:

$”.”.color= Color(“red”)

The color rectangle did not change color when the condition checked if the resource was not null.

To solve the problem, I tested again with a

If not ResourceLoader.exists(“user://”)

var statu= ResourceLoader.load(“res://”).duplicate()

ResourceSaver.save(statu, “user://”)

GS= ResourceLoader(“user://”

1 Like