Reputation: 175
I've been trying to import Open CV module to android studio exactly as many tutorials online told me to but it wont work. I googled the issue a bit and found a solution to choose the sdk folder as the directory and not java but even that dosent work.Im using Android Studio v4.0.1 and the latest version of OpenCV. Help.
Upvotes: 9
Views: 7926
Reputation: 89
If you are using Arctic fox and still facing this issue, This Solution worked for me.
If your next and/or finish buttons is still not clickable after adding the right path
https://stackoverflow.com/a/68738767/12052997
Upvotes: 0
Reputation: 1420
Importing opencv to androidstudio
->First download opencv from https://opencv.org/releases/ for your current using android studio version,and extract it. ->open android studio create new project if project is already exist follow the below. ->in android studio choose option in MENU->File->Import Module here please select the your opencv-android directory till sdk selection eg:("E:\stardev\OpenCV-android-sdk\sdk") and then finish, if your downloaded same version it's good to go else change the build.gradle setting from opencv build.gradle and sync. ->after this to add as a dependency in android studio Choose Menu->File->Project Structure->dependencies, select app from tab and add(+ icon) from menu select module dependency and select sdk from here. ->to test goto your project activity and (import org.opencv.core.Core)
Upvotes: 0
Reputation: 452
First of all make sure your sdk folder in your downloaded opencv sdk contains a build.gradle file. If your downloaded sdk doesn't have build.gradle try another version of opencv sdk, Unless you have to select java folder in the opencv sdk and after that copy jni files into your project tree. The easiest way to import OpenCV sdk into your project is as follow:
Upvotes: 25