Using Ketai library in Eclipse doesn't work, need gestures

edited October 2013 in Android Mode

Hi guys I need to implement Ketai library (or whatever library for gestures like directional swipe, double tap and long tap) in Eclipse (because apps works better and I need libpd).

It is for an universitary project and it's the first time I develop on Android using Processing in Eclipse.

I am now trying an app based on "Gestures" example that is in Ketai library in processing. It works on Processing, but when I try to use it on Eclipse it works and install the app, it runs, but when I tap the screen it crashes and give me a brunch of errors in logcat.

10-30 17:07:12.681: E/InputEventReceiver(13350): Exception dispatching input event. 10-30 17:07:12.681: E/MessageQueue-JNI(13350): Exception in MessageQueue callback: handleReceiveCallback 10-30 17:07:12.681: E/MessageQueue-JNI(13350): java.lang.NoClassDefFoundError: ketai.ui.KetaiGesture 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at com.rj.yayprocpd.YayProcessingPD.surfaceTouchEvent(YayProcessingPD.java:265) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at processing.core.PApplet$SketchSurfaceViewGL.onTouchEvent(Unknown Source) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.View.dispatchTouchEvent(View.java:7384) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1975) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1418) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.app.Activity.dispatchTouchEvent(Activity.java:2435) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1922) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.View.dispatchPointerEvent(View.java:7564) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:3883) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3778) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3483) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3540) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5419) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5399) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5370) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5493) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:182) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.os.MessageQueue.nativePollOnce(Native Method) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.os.MessageQueue.next(MessageQueue.java:132) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.os.Looper.loop(Looper.java:124) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at android.app.ActivityThread.main(ActivityThread.java:5303) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at java.lang.reflect.Method.invokeNative(Native Method) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at java.lang.reflect.Method.invoke(Method.java:525) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) 10-30 17:07:12.681: E/MessageQueue-JNI(13350): at dalvik.system.NativeStart.main(Native Method) 10-30 17:07:12.681: D/AndroidRuntime(13350): Shutting down VM 10-30 17:07:12.681: W/dalvikvm(13350): threadid=1: thread exiting with uncaught exception (group=0x414e4700) 10-30 17:07:12.691: E/AndroidRuntime(13350): FATAL EXCEPTION: main 10-30 17:07:12.691: E/AndroidRuntime(13350): java.lang.NoClassDefFoundError: ketai.ui.KetaiGesture 10-30 17:07:12.691: E/AndroidRuntime(13350): at com.rj.yayprocpd.YayProcessingPD.surfaceTouchEvent(YayProcessingPD.java:265) 10-30 17:07:12.691: E/AndroidRuntime(13350): at processing.core.PApplet$SketchSurfaceViewGL.onTouchEvent(Unknown Source) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.View.dispatchTouchEvent(View.java:7384) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) 10-30 17:07:12.691: E/AndroidRuntime(13350): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1975) 10-30 17:07:12.691: E/AndroidRuntime(13350): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1418) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.app.Activity.dispatchTouchEvent(Activity.java:2435) 10-30 17:07:12.691: E/AndroidRuntime(13350): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1922) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.View.dispatchPointerEvent(View.java:7564) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:3883) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3778) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3483) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3540) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5419) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5399) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5370) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5493) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:182) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.os.MessageQueue.nativePollOnce(Native Method) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.os.MessageQueue.next(MessageQueue.java:132) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.os.Looper.loop(Looper.java:124) 10-30 17:07:12.691: E/AndroidRuntime(13350): at android.app.ActivityThread.main(ActivityThread.java:5303) 10-30 17:07:12.691: E/AndroidRuntime(13350): at java.lang.reflect.Method.invokeNative(Native Method) 10-30 17:07:12.691: E/AndroidRuntime(13350): at java.lang.reflect.Method.invoke(Method.java:525) 10-30 17:07:12.691: E/AndroidRuntime(13350): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) 10-30 17:07:12.691: E/AndroidRuntime(13350): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) 10-30 17:07:12.691: E/AndroidRuntime(13350): at dalvik.system.NativeStart.main(Native Method)

It happens when i touch the screen, causing crash of the app.

Thanks to all

Answers

  • OK I skiped the declaration of the ketai object gesture = new KetaiGesture(this);

    But now I can't run app anymore, it give me some errors:

    10-31 11:41:33.208: E/AndroidRuntime(10587): FATAL EXCEPTION: GLThread 687 10-31 11:41:33.208: E/AndroidRuntime(10587): java.lang.NoClassDefFoundError: ketai.ui.KetaiGesture 10-31 11:41:33.208: E/AndroidRuntime(10587): at com.rj.yayprocpd.YayProcessingPD.setup(YayProcessingPD.java:66) 10-31 11:41:33.208: E/AndroidRuntime(10587): at processing.core.PApplet.handleDraw(Unknown Source) 10-31 11:41:33.208: E/AndroidRuntime(10587): at processing.opengl.PGL$AndroidRenderer.onDrawFrame(Unknown Source) 10-31 11:41:33.208: E/AndroidRuntime(10587): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523) 10-31 11:41:33.208: E/AndroidRuntime(10587): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

    Some ideas? Thanks

  • OK after some tests it works :)

    I had to include Ketai library when exporting. It's pretty logical that it need to export library with the project, so the procedure is:

    1. Right click on the project
    2. Select Properties
    3. Select Java Build Path on the left
    4. Select Order and Export tab
    5. Select library that you want to export with the project

    Hope that it can help someone with the same problems

Sign In or Register to comment.