Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV Android Library Errors after installation

Tags:

android

opencv

I use Win 8, jdk7, Eclipse 4.2, Andoird SDK (ADT) Rev 21, OpenCV 2.4.3, C/C++ Dev. Tools 8.1.1. Installed are all Android Target SDK's since API Level 8. As described in: http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html

After importing the library and sample projects I receive following errors in the File OpenCVEngineInterface. It's the same with 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
like image 406
Dirk Siegmund Avatar asked Nov 14 '12 22:11

Dirk Siegmund


2 Answers

Concretely yesterday night, I got the same problem as you and today I've found the solution. Apparently, or our Eclipse's have some default configuration or the Eclipse Projects we got from OpenCV are wrong.

To solve the problem, go to your project under Eclipse and:

  1. Right mouse button
  2. Properties
  3. Java Compiler
  4. Compiler Compliance Level = 1.6

I had the Java version 1.5 and it has some problems with overriding methods, but with Java 1.6 it's working fine! I hope I've helped you :D

EDIT: The solution I've exposed it's better than the other one. You don't have to change your ADT, just change the version of the Java Compiler and it will work without problems :D

like image 81
xarlymg89 Avatar answered Oct 04 '22 21:10

xarlymg89


Looks like some incompatibilities in Eclipse project settings between different version of ADT plug-in. To remove those errors you have to delete .settings folder from /sdk/java folder before export to Eclipse. thanks to: Andrey Pavlenko http://answers.opencv.org/question/4209/build-errors-after-opencv-library-import/

like image 20
Dirk Siegmund Avatar answered Oct 04 '22 22:10

Dirk Siegmund