You're welcome! I'm glad we were able to help. Very often a problem in the binary data is not recoverable.
Note you can post in Chinese, the forum has a button that translates it into English for me, so it's easy to communicate in different languages. For you, there should be a button to translate my English posts into Chinese:
Loading Image
Unfortunately it's difficult to find the position in the file that has the problem. To solve it yourself, you would need to try to load the data using a 3.6 runtime and write code that keeps track of how many bytes were read before the error. Then you need to edit the file with a hex editor and change the bad bytes.
That's probably too hard for most people. Here, we created a new 3.6.53 Skeleton Viewer that reports the byte offset when reading a binary file:
http://esotericsoftware.com/files/skeletonViewer-3.6.53.jar
When you load your original project with it, you'll see an error like this:
java.lang.RuntimeException: Error at byte: 270197
at com.esotericsoftware.spine.SkeletonViewer$3.readSkeletonData(SkeletonViewer.java:216)
at com.esotericsoftware.spine.SkeletonViewer.loadSkeleton(SkeletonViewer.java:221)
at com.esotericsoftware.spine.SkeletonViewer.create(SkeletonViewer.java:133)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:150)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:127)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 453
at com.badlogic.gdx.utils.Array.get(Array.java:156)
at com.esotericsoftware.spine.SkeletonBinary.readAttachment(SkeletonBinary.java:499)
at com.esotericsoftware.spine.SkeletonBinary.readSkin(SkeletonBinary.java:339)
at com.esotericsoftware.spine.SkeletonBinary.readSkeletonData(SkeletonBinary.java:277)
at com.esotericsoftware.spine.SkeletonViewer$3.readSkeletonData(SkeletonViewer.java:207)
... 4 more
That's the byte offset you need: 270197
. Open the .skel
file in a hex editor. I like XVI32 (here is the download link). Click Address
> Goto
and type 270197
:
Loading Image
The cursor jumps to that address:
Loading Image
Don't worry that the binary data doesn't make sense. The problem is just before the cursor: FF FF FF FF 0F
are the bytes that mean -1
. We need to replace them with 00
. Select the first FF
and press delete 4 times, then type 00
to replace the 0F
. Now it looks like:
Loading Image
Save the file, and it's fixed!