Godot Android build not opening

adb logcat -s godot

04-04 05:21:47.173  2369  2399 E godot   : Do you have a compatible Vulkan installable client driver (ICD) installed?
04-04 05:21:47.173  2369  2399 E godot   : vkEnumeratePhysicalDevices Failure.
04-04 05:21:47.173  2369  2399 E godot   :    at: _initialize_devices (drivers/vulkan/rendering_context_driver_vulkan.cpp:830)
04-04 05:21:47.173  2369  2399 E godot   : ERROR: Condition "err != OK" is true. Returning: err
04-04 05:21:47.173  2369  2399 E godot   :    at: initialize (drivers/vulkan/rendering_context_driver_vulkan.cpp:934)
04-04 05:21:47.173  2369  2399 E godot   : WARNING: Your device seem not to support Vulkan, switching to OpenGL 3.
04-04 05:21:47.173  2369  2399 E godot   :    at: DisplayServerAndroid (platform/android/display_server_android.cpp:677)04-04 05:21:47.198  2369  2399 E godot   : WARNING: Failed to load cached shader, recompiling.
04-04 05:21:47.198  2369  2399 E godot   :    at: _load_from_cache (drivers/gles3/shader_gles3.cpp:618)
04-04 05:21:47.273  2369  2399 I godot   : OpenGL API OpenGL ES 3.1 V132 - Compatibility - Using Device: Qualcomm - Adreno (TM) 640
04-04 05:21:47.281  2369  2399 I godot   :
04-04 05:21:48.010  2369  2399 I godot   : <Resource#-9223372006102137568>
04-04 05:21:48.010  2369  2399 I godot   : 7
04-04 05:21:48.011  2369  2399 I godot   : <Resource#-9223372006102137568>

Before implementing the Save - Load system, it was working on Android. However, after I added the Save - Load system, it works fine on PC, but when I try to test it on Android, it no longer works. Could this be related to the Save - Load system?

Save-Load script

extends Node

const dir = "user://saves/"
const fileDir = "save.json"

@export var key: String

var player_data: Player_Data = Player_Data.new()

func _ready() -> void:
	verify_save_directory(dir)

func verify_save_directory(path: String):
	DirAccess.make_dir_absolute(path)
	

func save_data():
	var file = FileAccess.open_encrypted_with_pass(dir + fileDir, FileAccess.WRITE, key)
	if file == null:
		print(FileAccess.get_open_error())
		return
	
	## data ile ref eĹźle
	player_data = Ref.player_data
	
	var game_data = {
		"player_data": {
			"max_level": player_data.max_level,
			"last_level": player_data.last_level,
			
		}
	}
	
	var json = JSON.stringify(game_data, "\t")
	file.store_string(json)
	file.close()
	
func load_data():
	
	if FileAccess.file_exists(dir+fileDir):
		var file = FileAccess.open_encrypted_with_pass(dir + fileDir, FileAccess.READ, key)
		if file == null:
			return
		var content = file.get_as_text()
		file.close()
		
		var data = JSON.parse_string(content)
		if data == null:
			return
		
		Ref.player_data = Player_Data.new()
		Ref.player_data.last_level = data.player_data.last_level
		Ref.player_data.max_level = data.player_data.max_level
			
			
	else: 
		Ref.player_data = Player_Data.new()
                print(player_data)
		save_data()
		load_data()

1 Like

Hi, i noticed that you didn’t make the “path: String” in the functions: “save_data()” and “load_data()”, you also switched “if FileAccess.file_exists(path)” to: “if FileAccess.file_exists(dir+file)” could you explain why? Because if i remember correctly… In the tutorial i watched, he used “path”

And i am a mobile coder, and his tutorial works for me, and my game works too

1 Like

When calling load_data(path: String), I will pass the parameter as load_path(dir + file). So, nothing will change.

In the tutorial series, the save and load methods also receive dir + file as the parameter.
Because we need to declare the file path.

My English bad, sorry.

1 Like

Oh, well, i have another guess… in your else line on the bottom of your code…

the save_data() and load_data() might be the one destroying your phone, i’m not a smart coder at all, i’m just a coder, so i’m not sure if my answers are good

1 Like

I don’t know that part yet. In the end, I had made sure that it creates a new save if it doesn’t find the file.

Now, instead of Godot, I wrote the package name of my game to adb logcat, and this is the result it returned

04-04 07:05:57.736  2592  2592 I com.mypacket.my_game: type=1400 audit(0.0:3710): avc: denied { execute_no_trans } for comm=474C546872656164203330 path="/apex/com.android.runtime/bin/crash_dump64" dev="sda6" ino=462 scontext=u:r:untrusted_app:s0:c57,c256,c512,c768 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=1 app=com.mypacket.my_game

Note: After removing the save-load system, the Android build worked. The issue: My Save-load system.

1 Like

Interesting… what was the problem in your save load system? I followed the exact tutorial that you watched (i think) and mine works perfectly fine (well… i used open_compressed instead of open_with_excrypted)

1 Like

If there is no game save file, what code should be used to create one? I was searched but i’m not found. My issue: Not found save file.


var file = FileAccess.open_encrypted_with_pass(dir + fileDir, FileAccess.WRITE, key)
	if file == null:
		print(FileAccess.get_open_error())
		return
1 Like

The problem is; Since Ref is a global node, it starts before Save Node and tries to access Save in its own start method. I fixed the problem, it works fine.

1 Like