Reputation: 205
I have OpenCV and Android set up in my Eclipse. The following is one of my layout files:
<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="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<org.opencv.android.JavaCameraView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="gone"
android:id="@+id/hello"
opencv:show_fps="true"
opencv:camera_id="any" />
</LinearLayout>
The Eclipse compiler complains about:
No resource identifier found for attribute 'show_fps' in package
No resource identifier found for attribute 'camera_id' in package
Upvotes: 6
Views: 4214
Reputation: 623
The two previously given answers to this question, in my opinion, are bandaids to the actual problem. When I encountered this error message, I needed to change some project properties.
If the OpenCV library is not present or has a red X next to it, you need to fix the Library dependency. To do this:
Upvotes: 1
Reputation: 4127
Please add following resource file in your project's values directory :
attrs.xml
with following content :
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name = "CameraBridgeViewBase" >
<attr name="show_fps" format="boolean"/>
<attr name="camera_id" format="integer" >
<enum name="any" value="-1" />
<enum name="back" value="0" />
<enum name="front" value="1" />
</attr>
</declare-styleable>
</resources>
Upvotes: 7
Reputation: 1945
you did not given value for this variables or not declare in opencv class..
opencv {
show_fps="true"
camera_id="any"
}
First assign the those two variables globally with necessary values....
Upvotes: 0