Ask Your Question
0

Cannot find class JavaCameraView declared in xml

asked 2013-05-18 12:51:45 -0500

Robert Kilar gravatar image

I have added openCv library to my project. There is no problem to import any openCv class into my .java file. But when I added this to my xml:

<org.opencv.android.JavaCameraView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/camera_surface_view" />

I get this error while running the application:

  05-18 19:26:54.420: E/AndroidRuntime(30676): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.szpieg2/com.example.szpieg2.TrackActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class org.opencv.android.JavaCameraView

Sample projects using JavaCameraView are working on my device(Galaxy Note II) I do not understand why it cannot locate it in one project and does in the other. Maybe I did not setup something? Please help.

Full XML:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:opencv="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     >

     <org.opencv.android.JavaCameraView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/color_blob_detection_activity_surface_view" />


</LinearLayout>
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-07-28 15:17:13 -0500

It looks like you export OpenCV library project with some errors or do not add add dependency against OpenCV library project in your project. See official tutorial for more info.

edit flag offensive delete link more
0

answered 2013-07-25 00:49:44 -0500

I'm getting the same problem. Did you find a solution?

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-05-18 12:51:45 -0500

Seen: 3,297 times

Last updated: Jul 28 '13