My app, heavily based on the OpenCV sample (Sample 2 with camera) links to OpenCV 2.4.0. After trouble-free work for a month or so I suddenly suffered from the dreaded "Dalvik error 1" problem. When the usual fixes didn't work, I decided to build a new project from scratch with the same source files hoping that would solve the problem...
Well it builds, but crashes on launch. Here's the console content:
06-07 14:01:01.383: D/dalvikvm(20915): Trying to load lib /data/data/barry.opencvdemo/lib/libopencv_java.so 0x4051c988
06-07 14:01:02.204: D/dalvikvm(20915): Added shared lib /data/data/barry.opencvdemo/lib/libopencv_java.so 0x4051c988
06-07 14:01:02.354: D/AndroidRuntime(20915): Shutting down VM
06-07 14:01:02.354: W/dalvikvm(20915): threadid=1: thread exiting with uncaught exception (group=0x4001d5a0)
06-07 14:01:02.374: E/AndroidRuntime(20915): FATAL EXCEPTION: main
06-07 14:01:02.374: E/AndroidRuntime(20915): java.lang.RuntimeException: Unable to start activity ComponentInfo{barry.opencvdemo/barry.opencvdemo.Sample2NativeCamera}: java.lang.NullPointerException
06-07 14:01:02.374: E/AndroidRuntime(20915): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1872)
06-07 14:01:02.374: E/AndroidRuntime(20915): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1893)
06-07 14:01:02.374: E/AndroidRuntime(20915): at android.app.ActivityThread.access$1500(ActivityThread.java:135)
06-07 14:01:02.374: E/AndroidRuntime(20915): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1054)
06-07 14:01:02.374: E/AndroidRuntime(20915): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 14:01:02.374: E/AndroidRuntime(20915): at android.os.Looper.loop(Looper.java:150)
06-07 14:01:02.374: E/AndroidRuntime(20915): at android.app.ActivityThread.main(ActivityThread.java:4385)
06-07 14:01:02.374: E/AndroidRuntime(20915): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 14:01:02.374: E/AndroidRuntime(20915): at java.lang.reflect.Method.invoke(Method.java:507)
06-07 14:01:02.374: E/AndroidRuntime(20915): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
06-07 14:01:02.374: E/AndroidRuntime(20915): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
06-07 14:01:02.374: E/AndroidRuntime(20915): at dalvik.system.NativeStart.main(Native Method)
06-07 14:01:02.374: E/AndroidRuntime(20915): Caused by: java.lang.NullPointerException
06-07 14:01:02.374: E/AndroidRuntime(20915): at barry.opencvdemo.Sample2NativeCamera.onCreate(Sample2NativeCamera.java:47)
06-07 14:01:02.374: E/AndroidRuntime(20915): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
06-07 14:01:02.374: E/AndroidRuntime(20915): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1836)
06-07 14:01:02.374: E/AndroidRuntime(20915): ... 11 more
Everything seems to be in the right place and with the right names, but something is not working. Is the above enough for someone to point out something obvious I'm missing or should I post some source code? The code itself was working... it's something about the settings for the build or the link I fear.
When the gods do something about the whole Dalvik Error 1 business I for one will be very happy.
Many thanks for any suggestions.