0 votes

Hey all,

I have a game which loads json data files, which are located under res://. When debugging on my computer (windows), it handles this completely fine. However, when I attempt to run the game on android, it crashes. Using the android emulator and adb logcat, i get the following:

godot : **ERROR**: File must be opened before use. godot : At: core/bind/core_bind.cpp:2023:get_as_text() - Condition "!f" is true. Returned: String() godot : **ERROR**: Error parsing JSON at line 0: godot : At: core/bind/core_bind.cpp:3220:parse() - Error parsing JSON at line 0: godot : **ERROR**: File must be opened before use. godot : At: core/bind/core_bind.cpp:2023:get_as_text() - Condition "!f" is true. Returned: String() godot : **ERROR**: Error parsing JSON at line 0: godot : At: core/bind/core_bind.cpp:3220:parse() - Error parsing JSON at line 0: godot : **ERROR**: File must be opened before use. godot : At: core/bind/core_bind.cpp:2023:get_as_text() - Condition "!f" is true. Returned: String() godot : **ERROR**: Error parsing JSON at line 0: otengine.gamen: System.exit called, status: 0 AndroidRuntime: VM exiting with result code 0, cleanup skipped.
It's most likely irrelevant, but the error repeated itself a lot more times than I included--I just stripped out most of the repetitions for brevity's sake.

After searching up similar problems with android, apparently the difference between case-insensitive filepaths in windows and case-sensitive filepaths in android is the primary cause of android crashes. However, I am nearly certain that all of my filepaths are correct, and the error messages (at least to me), don't seem to point towards a filepath issue.

Does anybody know what else might be causing this issue? Any help is appreciated.

Windows 10 Home 1903
Godot 3.2.1 Stable

in Engine by (172 points)

Did you specify *.json in the non-resource export filter in the Android export preset?

I didn't, everything works perfectly after adding *.json and *.txt to my non-resource export filter. Thanks a lot!

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.