Ask Your Question
1

cannot make android 2.4.4 Tutorial2-MixedProcessing work

asked 2013-03-02 10:08:03 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Hello , I downloaded latest release of opencv 2.4.4. I try to compile the project of Tutorial2-MixedProcessing with out the feature detection (JNI). Answers to any one of the following two tests is welcome Thanks a lot

Test 1 I created a new android project and imported the sample code. As I do not need the feature detection, which uses the JNI, I removed the jni folder and the corresponding java code.

Then the eclipse report a build error:

> 16:53:07 **** Auto Build of configuration Default for project OpenCV Tutorial 2 - Mixed Processing ****
"D:\\adt-bundle-windows-x86_64\\ndk\\ndk-build.cmd" 
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ./jni/Android.mk    
D:/adt-bundle-windows-x86_64/ndk/build/core/add-application.mk:165: *** Android NDK: Aborting...    .  Stop.

Do I need to remove other files or settings to make it compile?

Test 2 As all the way cannot work. I created a new empty project and copied the java code , resources, AndroidManifest.xml of Tutorial2-MixedProcessing. Then the compile works. But when I try to start the app on my android 4.2.2 I got the following error stack and the app crashed.While I included the opencvlibrary-2.4.4.jar and exported the jar with my apk. Do anyone know why?

***03-02 16:17:58.102: E/AndroidRuntime(6060): Caused by: java.lang.NoClassDefFoundError: org.opencv.R$styleable***


> 03-02 16:17:58.102: E/AndroidRuntime(6060): FATAL EXCEPTION: main
03-02 16:17:58.102: E/AndroidRuntime(6060): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.opencvtest/com.example.opencvtest.Tutorial2Activity}: android.view.InflateException: Binary XML file line #7: Error inflating class org.opencv.android.JavaCameraView
03-02 16:17:58.102: E/AndroidRuntime(6060):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
03-02 16:17:58.102: E/AndroidRuntime(6060):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
03-02 16:17:58.102: E/AndroidRuntime(6060):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
03-02 16:17:58.102: E/AndroidRuntime(6060):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
03-02 16:17:58.102: E/AndroidRuntime(6060):     at android.os.Handler.dispatchMessage(Handler.java:99)
03-02 16:17:58.102: E/AndroidRuntime(6060):     at android.os.Looper.loop(Looper.java:137)
03-02 16:17:58.102: E/AndroidRuntime(6060):     at android.app.ActivityThread.main(ActivityThread.java:5041)
03-02 16:17:58.102: E/AndroidRuntime(6060):     at java.lang.reflect.Method.invokeNative(Native Method)
03-02 16:17:58.102: E/AndroidRuntime(6060):     at java.lang.reflect.Method.invoke(Method.java:511)
03-02 16:17:58.102: E/AndroidRuntime(6060):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-02 16:17:58.102: E/AndroidRuntime(6060):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-02 16:17:58.102: E/AndroidRuntime(6060):     at dalvik.system.NativeStart.main(Native Method)
03-02 16:17:58.102: E/AndroidRuntime(6060): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class org.opencv.android.JavaCameraView
03-02 16 ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-03-04 01:48:07 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

  1. Old project with JNI code used CDT builder to build native part. You can remove it or alternatively use Tutorial-1 sample that just show preview from camera and does not use native code.

  2. It looks like you have some inconsistency in package names, class names in java code, manifest and layout files. Do not forget to and dependency from OpenCV library project.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-03-02 10:08:03 -0600

Seen: 1,778 times

Last updated: Mar 04 '13