[英]No resource identifier found for attribute 'paddingEnd' in Package 'android'
[英]Android OpenCV : No resource identifier found for attribute 'camera_id' in package
我在Eclipse中設置了OpenCV和Android。 以下是我的布局文件之一:
<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>
Eclipse編譯器抱怨:
No resource identifier found for attribute 'show_fps' in package
No resource identifier found for attribute 'camera_id' in package
請在項目的values目錄中添加以下資源文件:
attrs.xml
以下內容:
<?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>
在我看來,這兩個先前給出的問題的答案是對實際問題的綳帶。 當我遇到此錯誤消息時,我需要更改一些項目屬性。
如果OpenCV庫不存在或旁邊有紅色X,則需要修復庫依賴項。 去做這個:
你沒有給這個變量賦值或者沒有在opencv類中聲明..
opencv {
show_fps="true"
camera_id="any"
}
First assign the those two variables globally with necessary values....
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.