Android: Can't preload scene

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By AlGrande
:warning: Old Version Published before Godot 3 was released.

On Android it can’t preload a scene. It works on Windows.
Code:
Touchscreenbutton:

func _on_TouchScreenButton_pressed():
	hero.skill1android = true

hero:

func process_Android(delta):
    	if(skill1android == true and skill1_Activated == true):
    		skill1android = false
    		skill1_Activated = false
    		senpai()
    
func senpai():
	print("3")
	var senpai = preload("res://objects/senpai.scn").instance()
	var pos = get_pos()
	if(dir == "RIGHT"):
		pos.x = pos.x + 100
		pos.y = pos.y - 120
	else:
		pos.x = pos.x - 100
		pos.y = pos.y - 120
	senpai.set_pos(pos)
	get_node("../..").add_child(senpai)

Logcat:

I/godot   ( 3224): ERROR: start: Condition ' !scene ' is true. returned: false
I/godot   ( 3224):    At: main/main.cpp:1464.
I/godot   ( 3224): ERROR: load_interactive: Condition ' err!=OK ' is true. returned: Ref<ResourceInteractiveLoader>()
I/godot   ( 3224):    At: core/io/resource_format_binary.cpp:1081.
I/godot   ( 3224): ERROR: load: Method/Function Failed, returning: RES()
I/godot   ( 3224):    At: core/io/resource_loader.cpp:218.
I/godot   ( 3224): ERROR: poll: Method/Function Failed, returning: error
I/godot   ( 3224):    At: core/io/resource_format_binary.cpp:681.
I/godot   ( 3224): ERROR: load: Condition ' err!=OK ' is true. returned: RES()
I/godot   ( 3224):    At: core/io/resource_loader.cpp:142.
I/godot   ( 3224): ERROR: load: Method/Function Failed, returning: RES()
I/godot   ( 3224):    At: core/io/resource_loader.cpp:218.
I/godot   ( 3224): SCRIPT ERROR: GDScript::load_byte_code: Parse Error: Can't preload resource at path: res://objects/senpai.scn
I/godot   ( 3224):    At: res://scripts/hero.gdc:251.
I/godot   ( 3224): ERROR: load_byte_code: Method/Funct

It’s strange that this code works:

var shot = preload("res://objects/spit.scn").instance()

I get the error right when starting the game. I did not click anything and the game didn’t load yet.
How can I fix it? This time I installed the newest export templates…

did you check if senpai.scn file exists under assets/objects/ in APK?
The filename is correct senpai.scn, not Senpai.scn?

volzhs | 2016-07-15 17:06

An old project of mine used preloading just fine on Android, but I had the scene preload into a member variable instead of in a method. Maybe try that…

batmanasb | 2016-07-15 19:43

@volzhs the filename is correct.
@batmanasb nothing changed.
Also, if I use preload("res://objects/spit.scn") instead of preload("res://objects/senpai.scn"), I don’t get an error. So the problem is the senpai.scn
But why?

AlGrande | 2016-07-16 11:39

:bust_in_silhouette: Reply From: AlGrande

I fixed it. The problem was, that I used the letter ö in the name of a sprite.