#Json not working with Androir APK

1 messages · Page 1 of 1 (latest)

tall glade
#

Hi !
I have JSON files that I read with Godot.FileAcces(). When builing on my pc, it works well
BUT when building on an apk for my Android, godot wont read my JSON 🥺

Can you help me ?
Thanks :)

#

using godot 4.2.2-stable, C#, Samsung Galaxy S10

worthy dirge
#

did you add it to your exported resources

tall glade
#

is it on android studio ?

worthy dirge
tall glade
fallen frigate
tall glade
fallen frigate
#

What do u mean its a good tip 🤣

tall glade
#

I do use git, some people in my class had issues because they had an other version of java installed on them computer because of minecraft. I tried to uninstall all version of java, reinstall java, now it won't work

tall glade
fallen frigate
#

What version did you install?

tall glade
#

thanks for trying to help, I appreciate that

#

yeah I know, I am french

tall glade
#

(similaire in some ways of the godot docs)

fallen frigate
#

this means that the signature, like security code for your current project isn't the same as your current export, this probaly has to do with reinstalling the versions.
You could prob just delete the current signature with ps command: adb uninstall com.isartdigital.overlapping
This will remove all the settings, and potential save games on the version that is already on ur phone though.

Deleting this makes sure godot can just cleanly create a new export instead of upgrading the exsisting one.

#

Ofcourse, if you still have the correct signature you can just update this in your project settings.

tall glade
#

Now, I am back to the "my apk can't read my json for some reason" 😭

#

But it's a step, thank you :)

#

I tryed to add " *.json " in the export ressources as @worthy dirge mentionned but it still don't work... :(

fallen frigate
#

is the json in the project folder and not somewhere else on ur pc ?

tall glade
tall glade
#

ok, it's because my json were in a folder called "JSON" instead of "data"

#

AND : my game still doesnt work 🥲

worthy dirge
#

it does work if you make a desktop export right? Any errors in the log file? Not sure where that file is saved on android tho

fallen frigate
tall glade
tall glade
worthy dirge
tall glade
#

I use this to try on my phone and I don't know where to look to see logs

worthy dirge
#

ah if it's remote deployed it should go to the console

tall glade
#

I don't have any errors in my console

worthy dirge
#

how are you reading the file

tall glade
fallen frigate
#

is that still the problem though, that the game isn't reading the json files?

worthy dirge
#

Uh not sure how to get the open error from FileAccess in c# but there should be a way. Try printing that one instead to see what caused the null

tall glade
#

I can read the json on my phone now !

My game still doesn't work