Ask Your Question

Revision history [back]

OpenCV 4.1.0 import to AndroidStudio

I can't seem to figure out getting openCV setup correctly in Android Studio. Should I just switch to eclipse? If I open as existing AS project, it doesn't work at all. If I import gradle project, it seems to want to override the gradle file. I tried overriding with the existing gradle file, but it still doesn't work.

At the moment, face-detect project gets the wrong path/project for the java code. Android Studio thinks the package is main.java.org.opencv.samples.facedetect Also, it's looking for the CMakeLists.txt in Face-detection/jni/CMakeLists.txt but it should be in Face-detection/src/main/jni/CMakeLists.txt It also complains in FdActivity.java that it doesn't know what "R" class is. If try 'moving' the source to the proper package location, it then complains that it doesn't know about the various field members of R.

Any pointers/suggestions would be greatly appreciated. A simple, "just use eclipse!" would be a valid suggestion at this point. Thanks