Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] [AGK] fromJSON and toJSON

Author
Message
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 13th May 2018 17:05 Edited at: 13th May 2018 17:17
These two functions are working really fine for me in Windows, but when I tried to use them in the Android AppGameKit Player it says can't recognize the JSON structure (screen attached)

Maybe I'm doing something wrong, so any feedback is welcome



The json structure
https://agkjson.firebaseio.com/.json

Using an array or an object I had the same result

http://www.nyan.cat/pirate

The author of this post has marked a post as an answer.

Go to answer

TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 14th May 2018 10:39
Works fine for me.
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 14th May 2018 10:52
Quote: "Works fine for me."

Thanks Tom, I'll try to update and try it again
http://www.nyan.cat/pirate
TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 14th May 2018 11:26
I take it back. The app runs fine in the AppGameKit player, but fails when it is compiled to an .apk.
It seems to be a problem connecting to the network.
TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 14th May 2018 11:39
After one more test, I discover that the .apk crashes when launched from the installer, but runs fine when launched from the icon.
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 14th May 2018 12:46
This post has been marked by the post author as the answer.
are you sure it's not being caused if it doesn't get a response and so is writing "Error"? maybe you should wait for the response a bit or make sure the response isn't "Error" before trying to process it?
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 14th May 2018 17:46 Edited at: 14th May 2018 18:02
TomToad wrote: "I take it back. The app runs fine in the AppGameKit player, but fails when it is compiled to an .apk."


It still not working for me in the AppGameKit Player for Android, i got the screen message with the parsing problem. I have the May 1 2018 Build.

smallg wrote: "are you sure it's not being caused if it doesn't get a response and so is writing "Error"? maybe you should wait for the response a bit or make sure the response isn't "Error" before trying to process it?"


I'll try and post the results, thanks

EDIT: In my case GetHTTPResponseReady(http) always returns -1 . Added a while



Thanks for your feedback I'll continue testing
http://www.nyan.cat/pirate
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 15th May 2018 17:11 Edited at: 17th May 2018 15:19
Ugh, I haven't this problem in iOS, just in Android,, maybe is any setting, I'll try to check

Edit: Nothing related with the device; I caught the error and it seems my fail,

The debugger is warning about a similar problem but it's working fine on Windows and iOs,, maybe Android is a bit more strict on that way so I'll check the caseSensitive words and a different approach loading.

And of course I'll post the results.

Thanks mates
http://www.nyan.cat/pirate
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 17th May 2018 15:16
They are really two awesome functions, thanks TGC.
http://www.nyan.cat/pirate
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 1st Jun 2018 02:53 Edited at: 1st Jun 2018 13:25
Solved, Increasing the HttpTimeout prevents downloading a truncated file and starts working fine

I had a low value


Thanks!

Related with: https://forum.thegamecreators.com/thread/221304
http://www.nyan.cat/pirate
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 7th Sep 2018 17:05
It's a bug in AppGameKit and still happening.

Please try to reproduce in a more complex objects
http://www.nyan.cat/pirate
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 11th Mar 2019 21:40
It was solved in
https://steamcommunity.com/games/325180/announcements/detail/1716334919785259621

Quote: ""We have fixed escaped JSON strings sometimes causing incorrect strings in AppGameKit""

Login to post a reply

Server time is: 2024-11-05 23:30:39
Your offset time is: 2024-11-05 23:30:39