Android OpenCV layout.xml命名空间未绑定
在本教程()中,我第一次看到了如何在android上使用OpenCV。我已经完成了所有步骤,在主活动布局的XML中有以下错误:名称空间未绑定。 有人知道怎么解决吗? 如果有帮助的话,我会留下pos布局的xml文件。 多谢各位 XML文件:Android OpenCV layout.xml命名空间未绑定,android,opencv,Android,Opencv,在本教程()中,我第一次看到了如何在android上使用OpenCV。我已经完成了所有步骤,在主活动布局的XML中有以下错误:名称空间未绑定。 有人知道怎么解决吗? 如果有帮助的话,我会留下pos布局的xml文件。 多谢各位 XML文件: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<org.opencv.android.JavaCameraView
android:id="@+id/cameraview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="gone"
opencv:camera_id="any"
opencv:show_fps="true" />
</android.support.constraint.ConstraintLayout>
错误:命名空间opencv未绑定您忘记了:
xmlns:opencv="http://schemas.android.com/apk/res-auto"
在根布局中(ConstraintLayout
)
另外,确保org.opencv.android.JavaCameraView
的依赖项已经添加到Build.gradle
中。或者至少,如果手动导入jar
文件,请确保在Build.gradle
文件中有库的实现