- Изменено
Invalid JSON error, only on Chinese systems
Hello!
We're seeing a very strange new issue on the live version of our game. Only recently, several new Chinese players have reported soft locks when loading into certain levels. We dug around in our logs and found that one particular Spine skel is erroring out:
Error reading skeleton JSON file for SkeletonData asset: Grogthud_SkeletonData
Invalid JSON.
at Spine.SkeletonJson.ReadSkeletonData (System.IO.TextReader reader) [0x0002f] in <6a185d91fb6246c5b7702c2c758bf6e4>:0
at Spine.Unity.SkeletonDataAsset.ReadSkeletonData (System.String text, Spine.AttachmentLoader attachmentLoader, System.Single scale) [0x00014] in <6a185d91fb6246c5b7702c2c758bf6e4>:0
at Spine.Unity.SkeletonDataAsset.GetSkeletonData (System.Boolean quiet) [0x000a5] in <6a185d91fb6246c5b7702c2c758bf6e4>:0
We've never seen anything like this before (the game has been out for over a year, with fair numbers of Chinese players that whole time, as far as we know). AND it's only happening for Chinese players. There is no separate Chinese build - it's all the same SKU, so the only difference for those players would be what the game language is set to, and/or what their system language is set to. I've tried reproducing it by changing both on my end, but no luck.
Kind of a strange one! Basically just wondering if you've ever seen or heard of anything like this before? Thanks for any insight you can provide
Chris
I suppose it's possible that you've run into a hardware error. Do you know what devices are having the problem? Can the same devices also run the app OK sometimes?
That looks like JSON. You could try using binary, which is better in every way (smaller on disk, faster to load) except a human can't read it.
Sorry to hear you're encountering issues!
As Nate suggested, the best way would be to use binary .skel.bytes
files.
Nevertheless, if you still want to ensure the issue can't happen with json files either, I assume that the problem might come from TextAsset.text
, where the Unity API documentation states: "Encodings are detected and interpreted automatically.". You could try their suggested workaround for explicit encodings "To use a specific encoding to decode a file, use TextAsset.bytes and C# encoding tools."
You would then need to replace the line below in SkeletonDataAsset.cs
, method public SkeletonData GetSkeletonData (bool quiet)
accordingly:
// skeletonJSON.text in the line below
loadedSkeletonData = SkeletonDataAsset.ReadSkeletonData(skeletonJSON.text, attachmentLoader, skeletonDataScale);