安装后OpenCV Android Library错误

时间:2012-11-14 22:26:01

标签: android opencv

我用 Win 8,jdk7,Eclipse 4.2,Andoird SDK(ADT)Rev 21,OpenCV 2.4.3,C / C ++ Dev。工具8.1.1。 安装自API级别8以来的所有Android Target SDK。如下所述: http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html

导入库和示例项目后,我在File OpenCVEngineInterface中收到以下错误。它与mac os相同。

Description Resource    Path    Location    Type 
The method asBinder() of type OpenCVEngineInterface.Stub must override a superclass method  OpenCVEngineInterface.java  /OpenCV Library -
2.4.3/gen/org/opencv/engine line 35 Java Problem 
The method asBinder() of type OpenCVEngineInterface.Stub.Proxy must override a superclass method    OpenCVEngineInterface.java  /OpenCV Library -
            2.4.3/gen/org/opencv/engine line 96 Java Problem 
The method getEngineVersion() of type OpenCVEngineInterface.Stub.Proxy must override a superclass method    OpenCVEngineInterface.java  /OpenCV Library - 2.4.3/gen/org/opencv/engine   line 107    Java Problem 
    The method getLibPathByVersion(String) of type OpenCVEngineInterface.Stub.Proxy must override a superclass method   OpenCVEngineInterface.java  /OpenCV Library - 2.4.3/gen/org/opencv/engine   line 129    Java Problem 
    The method installVersion(String) of type OpenCVEngineInterface.Stub.Proxy must override a superclass method    OpenCVEngineInterface.java  /OpenCV Library - 2.4.3/gen/org/opencv/engine   line 152    Java Problem 
    The method getLibraryList(String) of type OpenCVEngineInterface.Stub.Proxy must override a superclass method    OpenCVEngineInterface.java  /OpenCV Library - 2.4.3/gen/org/opencv/engine   line 175    Java Problem

4 个答案:

答案 0 :(得分:12)

具体到昨天晚上,我遇到了和你一样的问题,今天我找到了解决办法。显然,或者我们的Eclipse有一些默认配置,或者我们从OpenCV获得的Eclipse项目是错误的。

要解决此问题,请转到Eclipse下的项目并执行:

  • 鼠标右键 - >属性 - > Java编译器 - >编译器合规性级别= 1.6

我有Java 1.5版,它在覆盖方法方面存在一些问题,但是使用Java 1.6它运行正常!我希望我帮助过你:D

编辑:我公开的解决方案比另一个更好。您不必更改ADT,只需更改Java编译器的版本即可正常工作:D

答案 1 :(得分:1)

看起来不同版本的ADT插件之间的Eclipse项目设置中存在一些不兼容性。要删除这些错误,您必须在导出到Eclipse之前从/ sdk / java文件夹中删除.settings文件夹。感谢:Andrey Pavlenko http://answers.opencv.org/question/4209/build-errors-after-opencv-library-import/

答案 2 :(得分:0)

这里发布的解决方案对我有用......

http://answers.opencv.org/question/4209/build-errors-after-opencv-library-import/

在导入示例项目之前删除OpenCV-2 / sdk / java下的.settings文件夹。

答案 3 :(得分:0)

我也遇到了这个问题。

这是我的解决方案: 1.打开OpenCV-2.4.3-android-sdk \ sdk \ java.settings \ org.eclipse.jdt.core.prefs 2.更换1.5到1.6

这是因为java编译器版本。