• Building
  • How do I read and write to json files on Oculus Quest 2 (Android Runnable)?

I have exported my project to the Oculus Quest 2 (using Godot v3.2.3 and as an Android Export) and I am just trying to read and print some data in a json file. My code looks like this:

var file = File.new() var path = "user://save.json"

file.open(path, File.READ) var data = parse_json(file.get_as_text()) print (data)

However, it keeps printing out Null. Has anyone else encountered this error and have been able to solve it?

Thanks in advance.

This discussion was caught in the moderation queue since you have not confirmed your account yet.

Upon creating your account you should have received an account verification email. The confirmation email may have been incorrectly flagged as spam, so please also check your spam filter. Without confirming your account, future posts may also be caught in the moderation queue. You can resend a confirmation email when you log into your account if you cannot find the first verification email.

(Note: You do not need to repost, the discussion has been moved out and is visible now)

If you need any help, please let us know! You can find ways to contact forum staff on the Contact page. Thanks! :smile:

Welcome to the forums @semiflex!

Did you give your app file permissions on Android? I believe file permissions are needed to read from user:// in Godot. I believe the file permissions should be a checkbox in the export settings in the Godot editor.