Ask Your Question
0

How to run OpenCV Android Samples in Android Studio? [closed]

asked 2019-10-01 20:13:01 -0600

Witek gravatar image

updated 2019-10-01 20:15:28 -0600

I have been trying to run these samples for several hours, but I failed. I followed this tutorial successfully, but whenever I import any of the OpenCV Android samples I run into problems.

At first, right after I import a project I get this:

image description

After clicking 'OK' I get the 'SDK location not found' error, even though I put it as suggested. The local.properties file seems to be ignored.

image description

The above 'SDK not found' error will go away if I add a system variable as suggested, but then a similar one with NDK pops up.

What am I doing wrong? How can I run these samples with Android Studio? I am a complete novice to Android development. Any help will be appreciated.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by LBerger
close date 2019-10-02 14:45:30.639825

Comments

1

Thank you so much, it works now.

Witek gravatar imageWitek ( 2019-10-02 14:25:27 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-10-02 02:27:11 -0600

LBerger gravatar image

updated 2019-10-02 02:27:55 -0600

try to paste in G:\Lib\install\opencv\samples\settings.gradle (with your own path)

rootProject.name = 'opencv_samples'

def opencvsdk='../'
//def opencvsdk='/<path to OpenCV-android-sdk>'
//println opencvsdk
include ':opencv'
project(':opencv').projectDir = new File(opencvsdk + '/sdk')
include ':15-puzzle'
include ':face-detection'
include ':image-manipulations'
include ':camera-calibration'
include ':color-blob-detection'
include ':tutorial-1-camerapreview'
include ':tutorial-2-mixedprocessing'
include ':tutorial-3-cameracontrol'
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-10-01 20:13:01 -0600

Seen: 1,347 times

Last updated: Oct 01 '19