Ask Your Question
1

OpenCV for Android, Import Problems, Eclipse Kepler

asked 2014-02-27 16:30:54 -0600

Dbailey01 gravatar image

updated 2014-02-28 00:35:48 -0600

berak gravatar image

I have followed the tutorial for installation of the latest version of OpenCV, but have been getting a ton of errors. Every time i make one go away, another seems to pop up. Right now, I am faced with these:

Description Resource Path Location Type

ICE_CREAM_SANDWICH cannot be resolved or is not a field JavaCameraView.java /OpenCV Library - 2.4.8/src/org/opencv/android line 149 Java Problem

The method setRecordingHint(boolean) is undefined for the type Camera.Parameters JavaCameraView.java /OpenCV Library - 2.4.8/src/org/opencv/android line 150

make: * Android NDK: Aborting... . Stop. OpenCV Library - 2.4.8 line 187, external location: C:\AndroidTools\android-ndk-r9c\build\core\add-application.mk C/C++ Problem

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-02-27 20:20:20 -0600

habisravi gravatar image
  1. Try downloading ADT-Bundle from http://developer.android.com/sdk/index.html If you are using 64 bit download 64 bit version.
  2. Download NDK from http://developer.android.com/tools/sdk/ndk/index.html
  3. Download OpenCV for Android from http://sourceforge.net/projects/opencvlibrary/

  4. Open your Home Folder in Linux /C drive in Windows.

  5. Create a Folder "Android" to keep SDK, NDK, OpenCV SDK. Open the created Folder.
  6. Extract ADT-Bundle to "Android" folder.
  7. Extract NDK to "Android" folder.
  8. Don't rename the extracted folder. If you rename,You need to change Eclipse Prefernce. Open Eclipse>Window>Preferences>Android.
  9. In the Android Tab check your SDK location. If not correct Browse to extracted SDK location.

  10. To Add NDK Location open Eclipse>Window>Preferences>Android>NDK. Browse to extracted NDK folder.

  11. Extract OpenCVAndroid to "Android" folder.
  12. Now Open Eclipse>FIle>Import>Existing Android Code into WorkSpace> Browse to "Android/OpenCV-2.4.8-android-sdk/samples/". Select All project, Tick the CheckBox"Copy Project to WorkSpace". 13.Most probably you might get a lot of errors. 14.First you need to remove errors from "OpenCV Library - 2.4.8" project.
  13. Right click "OpenCV Library - 2.4.8">Android Tools>Fix Project Properties. if errors are not removed try deleting the contents of "gen" folder.
  14. For all other sample projects Right click the project, click Properties>Android>Library remove the library reference and click Add>Select OpenCV Libr ary - 2.4.8 17.If Error exist delete the contents of "gen" folder. 18.Depending on the Platform set NDK path for Ubuntu http://stackoverflow.com/questions/19608610/how-to-set-android-sdk-ndk-and-jdk-paths-in-ubuntu-12-04 for Windows set NDK and OpenCV path in WindowsEnvironment.
edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-02-27 16:30:54 -0600

Seen: 2,291 times

Last updated: Feb 27 '14