user2457516
user2457516

Reputation:

installing android OpenCV unable to locate error while building

I am trying to install Android OpenCV to work with it under eclipse. To do this I first installed NDK, ADT and the eclipse plugins. I am using Windows8 and Eclipse Juno.

With this I successfully build and ran the sample projects from NDK.

After that I imported the openCV Library - 2.4.6 Project into Eclipse and tried to build it. It failed. I tried to Clean the project it also fails. The Problem I get displayed when I try building is:

*** Android NDK: Please correct error. Aborting    .  Stop.

And no detail about where it failed or why. However the console gives me this output:

**** Build of configuration Default for project OpenCV Library - 2.4.6 ****

C:\workspace\android-ndk-r9\ndk-build.cmd all 
Android NDK: WARNING: APP_PLATFORM android-9 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml    
Android NDK: LOCAL_MODULE definition in jni/Android.mk must not contain space        

C:/workspace/android-ndk-r9/build/core/build-shared-library.mk:23: *** Android NDK: Please correct     error. Aborting    .  Stop.
**** Build Finished ****

Note that C:\workspace is not my active workspace for the openCV Library - 2.4.6 project.

How can I gather more Information about the error? And how do I resolve it?

Upvotes: 2

Views: 1668

Answers (3)

Pav
Pav

Reputation: 66

I had this same problem when working with OpenCV4Android SDK. I actually went into the jni folder of my project in eclipse and edited the Android.mk file to take out the spaces. I then had to change the .cpp file in that same folder to match the name. After that the project built.

Also, for anyone else that is working with this same sdk in eclipse, I had another problem where I had to also manually include the JRE for each project. Eclipse couldn't find the system libraries itself. This isn't related to your question but might help others who stumble across this page looking for answers.

Upvotes: 4

dcoz
dcoz

Reputation: 1286

Open the 'jni/Android.mk' file of your failing project.

Make sure the variables LOCAL_MODULES and LOCAL_SRC_FILES are set to unique variables with no spaces in them.

Then rename the 'jni/OpenCV library - 2.4.6.cpp' file to the filename you use for the LOCAL_SRC_FILES variable.

In case that doesn't work, you may find additional troubleshooting info in that other related post: https://stackoverflow.com/a/19082734/646474

Upvotes: 0

Milan Tenk
Milan Tenk

Reputation: 2715

Try to change the minSdkVersion in the manifest over level 9.

Upvotes: 0

Related Questions