Please help with Ninja demo setup.

Started by moodroid, February 23, 2015, 01:56:08 AM

Previous topic - Next topic

moodroid

Hello.

I tried running the Ninja demo using Android Studio and the ADB.
I know it was an eclipse project originally.
after adding some libs to the project I got it to compile with no errors.
However, It crashed when I tried running it on my phone and tablet.

I caught a runtime exception, I don't have the stack text but it went something like:
"   version mismatch Current version = 3 and stream version = 4.  "
BonesIO has an int VERSION=4 so I think this is the source of the problem.
-What does this mean?

1.Is the bones.jar from the bones homepage compatible with the ninja demo files?
2.Would this demo work on Jellybeans and Kitkat or is it designed for Lollipop?

Any help will be much appreciated.

*after I get it to work then I will upload a complete android studio project if you guys are interested...



moodroid

Hi again, attached is the error that I got.

Please ignore the long and useless package name "com.example.root.bonestry3.bones.samples.android.NinjaDemoActivity"
It is not the cause of the problem (the same errors also came up in my previous attempts to build this project)

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.root.bonestry3/com.example.root.bonestry3.bones.samples.android.NinjaDemoActivity}:

java.lang.RuntimeException: java.io.IOException: Version mismatch. Current version: 4, stream version: 3

            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2413)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
            at android.app.ActivityThread.access$900(ActivityThread.java:175)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:146)
            at android.app.ActivityThread.main(ActivityThread.java:5602)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
            at dalvik.system.NativeStart.main(Native Method)

**************************************************************************************************   
  Caused by: java.lang.RuntimeException: java.io.IOException: Version mismatch. Current version: 4, stream version: 3
            at com.example.root.bonestry3.bones.samples.android.NinjaDemoActivity.onCreate(NinjaDemoActivity.java:121)
**************************************************************************************************

            at android.app.Activity.performCreate(Activity.java:5451)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
            at android.app.ActivityThread.access$900(ActivityThread.java:175)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:146)
            at android.app.ActivityThread.main(ActivityThread.java:5602)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
            at dalvik.system.NativeStart.main(Native Method)

**************************************************************************************************     
Caused by: java.io.IOException: Version mismatch. Current version: 4, stream version: 3
            at raft.jpct.bones.BonesIO.readHeader(BonesIO.java:104)
            at raft.jpct.bones.BonesIO.loadGroup(BonesIO.java:85)
***************************************************************************************************

            at com.example.root.bonestry3.bones.samples.android.NinjaDemoActivity.onCreate(NinjaDemoActivity.java:115)
            at android.app.Activity.performCreate(Activity.java:5451)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
            at android.app.ActivityThread.access$900(ActivityThread.java:175)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:146)
            at android.app.ActivityThread.main(ActivityThread.java:5602)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
            at dalvik.system.NativeStart.main(Native Method)



raft

sorry for late answer.

Quote from: moodroid on February 23, 2015, 01:56:08 AM
1.Is the bones.jar from the bones homepage compatible with the ninja demo files?
yes, that is the cause:/ just copy Bones/samples/data/ninja/ninja.group.bones file to Android/res/raw folder.

Quote from: moodroid on February 23, 2015, 01:56:08 AM
2.Would this demo work on Jellybeans and Kitkat or is it designed for Lollipop?
it should work on Android 1.5 and later. but you need at least 2.2 for perforance (because of JIT)

Quote from: moodroid on February 23, 2015, 01:56:08 AM
*after I get it to work then I will upload a complete android studio project if you guys are interested...
sure, you can put it to wiki:)

moodroid

Thanks, it worked like magic.
A happy little ninja is backflipping on my screen. :-)
I will try to upload the fixed Android studio project later on today.

Please let me know if there is anything I can do to help
the Bones project and community.



raft


moodroid

Thanks for the help,

Project will soon be available on the JPCT wiki in the Bones subsection. (just as soon as I understand how to upload the zip there..)