Android Samples throw Class Not Found

asked 2013-05-15 07:16:34 -0500

TomJ gravatar image

I'm receiving a class not found exception for my main class when I try to use the samples provided by the Android sdk (version 2.4.5). I can download and run the samples from the play store, however. The development box I'm using is Ubuntu 13.04, and the android device I'm deploying to is a Nexus 7 with android 4.2.2.

I tried creating a stock android application, and it deploys and works fine, but it seems as soon as I add the BaseLoaderCallback this class not found error appears again.

Anyone have any ideas what is going on? I'm not trying to venture into the NDK yet, as I wanted to get the most basic setup done first.

For completeness, I've included the full log for the Puzzle 15 sample.

05-15 08:04:28.785: I/dalvikvm(20227): Failed resolving Lorg/opencv/samples/puzzle15/Puzzle15Activity; interface 23 'Lorg/opencv/android/CameraBridgeViewBase$CvCameraViewListener;'
05-15 08:04:28.785: W/dalvikvm(20227): Link of class 'Lorg/opencv/samples/puzzle15/Puzzle15Activity;' failed
05-15 08:04:28.785: D/AndroidRuntime(20227): Shutting down VM
05-15 08:04:28.785: W/dalvikvm(20227): threadid=1: thread exiting with uncaught exception (group=0x41310930)
05-15 08:04:28.785: E/AndroidRuntime(20227): FATAL EXCEPTION: main
05-15 08:04:28.785: E/AndroidRuntime(20227): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.opencv.samples.puzzle15/org.opencv.samples.puzzle15.Puzzle15Activity}: java.lang.ClassNotFoundException: Didn't find class "org.opencv.samples.puzzle15.Puzzle15Activity" on path: /data/app/org.opencv.samples.puzzle15-1.apk
05-15 08:04:28.785: E/AndroidRuntime(20227):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
05-15 08:04:28.785: E/AndroidRuntime(20227):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
05-15 08:04:28.785: E/AndroidRuntime(20227):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
05-15 08:04:28.785: E/AndroidRuntime(20227):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
05-15 08:04:28.785: E/AndroidRuntime(20227):    at android.os.Handler.dispatchMessage(Handler.java:99)
05-15 08:04:28.785: E/AndroidRuntime(20227):    at android.os.Looper.loop(Looper.java:137)
05-15 08:04:28.785: E/AndroidRuntime(20227):    at android.app.ActivityThread.main(ActivityThread.java:5041)
05-15 08:04:28.785: E/AndroidRuntime(20227):    at java.lang.reflect.Method.invokeNative(Native Method)
05-15 08:04:28.785: E/AndroidRuntime(20227):    at java.lang.reflect.Method.invoke(Method.java:511)
05-15 08:04:28.785: E/AndroidRuntime(20227):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-15 08:04:28.785: E/AndroidRuntime(20227):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-15 08:04:28.785: E/AndroidRuntime(20227):    at dalvik.system.NativeStart.main(Native Method)
05-15 08:04:28.785: E/AndroidRuntime(20227): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.opencv.samples.puzzle15.Puzzle15Activity" on path: /data/app/org.opencv.samples.puzzle15-1.apk
05-15 08:04:28.785: E/AndroidRuntime ...
(more)
edit retag flag offensive close merge delete

Comments

Looking at the logs a little more, I see the first line indicates it is failing to load the opencv library dependency. I'll have to play around with when I get the chance to see if that is really what is going on.

TomJ gravatar imageTomJ ( 2013-05-15 11:32:37 -0500 )edit