Exported app using Gradle's custom build crashes after splash screen on Android

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

I’m trying to export ( or even if i try to play it on godot’s editor by clicking on the android icon ) an application to android with custom build enabled on godot, but when i try to open it on Android it crashes after showing the game’s splash screen. This, however, does not happen when i export it with custom build disabled. Game also runs fine when exported to Windows.

When checking the logcat errors on AndroidStudio ( with my phone connected ) this errors appear:

2022-12-17 21:10:44.371 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Condition "err" is true. Returned: err
2022-12-17 21:10:44.371 18319-18345/com.fuerzastudio.citykitty E/godot:    at: load_source_code (modules/gdscript/gdscript.cpp:807) - Condition "err" is true. Returned: err
2022-12-17 21:10:44.371 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Cannot load source code from file 'res://scripts/screen_transition.gd'.
2022-12-17 21:10:44.371 18319-18345/com.fuerzastudio.citykitty E/godot:    at: load (modules/gdscript/gdscript.cpp:2209) - Condition "err != OK" is true. Returned: RES()
2022-12-17 21:10:44.371 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Failed loading resource: res://scripts/screen_transition.gd. Make sure resources have been imported by opening the project in the editor at least once.
2022-12-17 21:10:44.371 18319-18345/com.fuerzastudio.citykitty E/godot:    at: _load (core/io/resource_loader.cpp:271) - Condition "found" is true. Returned: RES()
2022-12-17 21:10:44.372 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: res://scenes/GUI/screen_transition.tscn:3 - Parse Error: [ext_resource] referenced nonexistent resource at: res://scripts/screen_transition.gd
2022-12-17 21:10:44.372 18319-18345/com.fuerzastudio.citykitty E/godot:    at: poll (scene/resources/resource_format_text.cpp:412) - res://scenes/GUI/screen_transition.tscn:3 - Parse Error: [ext_resource] referenced nonexistent resource at: res://scripts/screen_transition.gd
2022-12-17 21:10:44.372 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Failed to load resource 'res://scenes/GUI/screen_transition.tscn'.
2022-12-17 21:10:44.372 18319-18345/com.fuerzastudio.citykitty E/godot:    at: load (core/io/resource_loader.cpp:206) - Condition "err != OK" is true. Returned: RES()
2022-12-17 21:10:44.373 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Failed loading resource: res://scenes/GUI/screen_transition.tscn. Make sure resources have been imported by opening the project in the editor at least once.
2022-12-17 21:10:44.374 18319-18345/com.fuerzastudio.citykitty E/godot:    at: _load (core/io/resource_loader.cpp:271) - Condition "found" is true. Returned: RES()
2022-12-17 21:10:44.374 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Can't autoload: res://scenes/GUI/screen_transition.tscn
2022-12-17 21:10:44.374 18319-18345/com.fuerzastudio.citykitty E/godot:    at: start (main/main.cpp:1912) - Condition "res.is_null()" is true. Continuing.
2022-12-17 21:10:44.375 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Condition "err" is true. Returned: err
2022-12-17 21:10:44.376 18319-18345/com.fuerzastudio.citykitty E/godot:    at: load_source_code (modules/gdscript/gdscript.cpp:807) - Condition "err" is true. Returned: err
2022-12-17 21:10:44.376 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Cannot load source code from file 'res://scripts/name_dialog.gd'.
2022-12-17 21:10:44.376 18319-18345/com.fuerzastudio.citykitty E/godot:    at: load (modules/gdscript/gdscript.cpp:2209) - Condition "err != OK" is true. Returned: RES()
2022-12-17 21:10:44.376 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Failed loading resource: res://scripts/name_dialog.gd. Make sure resources have been imported by opening the project in the editor at least once.
2022-12-17 21:10:44.376 18319-18345/com.fuerzastudio.citykitty E/godot:    at: _load (core/io/resource_loader.cpp:271) - Condition "found" is true. Returned: RES()
2022-12-17 21:10:44.376 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: res://scenes/GUI/modal_layer.tscn:3 - Parse Error: [ext_resource] referenced nonexistent resource at: res://scripts/name_dialog.gd
2022-12-17 21:10:44.376 18319-18345/com.fuerzastudio.citykitty E/godot:    at: poll (scene/resources/resource_format_text.cpp:412) - res://scenes/GUI/modal_layer.tscn:3 - Parse Error: [ext_resource] referenced nonexistent resource at: res://scripts/name_dialog.gd
2022-12-17 21:10:44.376 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Failed to load resource 'res://scenes/GUI/modal_layer.tscn'.
2022-12-17 21:10:44.376 18319-18345/com.fuerzastudio.citykitty E/godot:    at: load (core/io/resource_loader.cpp:206) - Condition "err != OK" is true. Returned: RES()
2022-12-17 21:10:44.376 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Failed loading resource: res://scenes/GUI/modal_layer.tscn. Make sure resources have been imported by opening the project in the editor at least once.
2022-12-17 21:10:44.377 18319-18345/com.fuerzastudio.citykitty E/godot:    at: _load (core/io/resource_loader.cpp:271) - Condition "found" is true. Returned: RES()
2022-12-17 21:10:44.377 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Can't autoload: res://scenes/GUI/modal_layer.tscn
2022-12-17 21:10:44.377 18319-18345/com.fuerzastudio.citykitty E/godot:    at: start (main/main.cpp:1912) - Condition "res.is_null()" is true. Continuing.
2022-12-17 21:10:44.530 18319-18345/com.fuerzastudio.citykitty E/godot: ERROR: Condition "default_certs != nullptr" is true.
2022-12-17 21:10:44.530 18319-18345/com.fuerzastudio.citykitty E/godot:    at: load_default_certificates (modules/mbedtls/crypto_mbedtls.cpp:314) - Condition "default_certs != nullptr" is true.

But once again, none of these errors appear when exporting for windows or for android with custom build disabled.

What i’ve tried so far:

  • I have lots of files with underscores, i tried changing every single folder / file name to one that doesnt have underscores, hyphens or spaces.
  • Trying exporting with only armeabi-v7a enabled.
  • Trying exporting and testing in other devices.
  • Trying exporting on older godot versions.

But none of this worked.