I'm having trouble adding OpenCV to a new Android project

I made changes to several OpenCV projects in Android, however, I had problems using OpenCV in a new Android project.

Documentation

+7
source share
3 answers

When creating a new Android project you only need

  • add a link to the OpenCV project by going to the menu "Properties"> "Android"> "Library"> "Add and selecting the OpenCV library project"

You should not explicitly add an OpenCV library project to your new way to create an Android project:

  • add another link to your OpenCV project by choosing Properties> Java Build Path> Projects> Add ...

If you take the last step, you will get the exact error Could not find OpenCV-2.3.1.apk! described in the question.

Check out the new way to create an Android project and delete the OpenCV project, if it exists, then give it another try and see if that helps.

+17
source

When you add OpenCV from Properties-> Android-> libarary-> Add , you need to leave the "Cell" checkbox selected . Go to Project-> Properties-> Android and uncheck "Library" , and then try again. It should solve your problem (it was for me), but if she does not consider the answers to this question , as other people have found some other things to be also useful.

+2
source

I had this problem when I pulled the jni_part.cpp file from a sample project. I forgot to change the names of the functions to match the package name of the class from which I used them:

JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial3_Sample3Native_FindFeatures -> JNIEXPORT void JNICALL Java_<CLASSNAME_WITH_UNDERSCORES_INSTEAD_OF_DOTS>_<CLASS_NAME>_<METHOD_NAME> 

Hope this helps someone.

0
source

All Articles