I want to use OpenCV library in my app with Android Studio. I followed instructions found here but I get error
Configuration with name \'default\' no
For everyone who felt they want to run away with all the steps and screen shots on the (great!) above answers, this worked for me with android studio 2.2.1
:
Create a new project, name it as you want and take the default (minSdkVersion 15 is fine).
Download the zip file from here: https://sourceforge.net/projects/opencvlibrary/files/opencv-android/ (I downloaded 3.2.0 version, but there may be a newer versions).
Unzip the zip file, the best place is in your workspace folder, but it not really matter.
Inside Android Studio
, click File->New-> Import Module
and navigate to \path_to_your_unzipped_file\OpenCV-android-sdk\sdk\java
and hit Ok, then accept all default dialogs.
In the gradle
file of your app
module, add this to the dependencies block:
dependencies {
compile project(':openCVLibraryXYZ')
//rest of code
}
Where XYZ is the exact version you downloaded, for example in my case:
dependencies {
compile project(':openCVLibrary320')
//rest of code
}