Let’s say there is a JSON file lying in ./resources and named “String.json”. Then the parsing of this file can be implemented as follows:
Label Start:
$ Import json
$ F = Open (Renpy.Loader.transFN ("Resources / String.json"))
$ text = json.load (f)
on the PC and on the Android emulator such a script will work perfectly, but when I collect build and launch it on the phone, then the exception is departed:
Perhaps it is somehow connected with the architecture of APK-package, or some other nuances, but in the documentation I did not find solutions to this problem.
Answer 1
To resolve the exception, you can use the renpy.file
method
That is:
Label Start:
$ Import json
$ F = Renpy.file ("Resources / String.json")
$ text = json.load (f)