OpenCV4Android and IntelliJ IDEA

Hi,
I've been trying to compile OpenCV for android samples (http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.5/) under IntelliJ IDEA with no success. With Eclipse it works out ok, sometimes it gives me error which I solve by right-clicking on eclipse project (Android Tools -> Fix Project Propeties).

Is there anyone who was able to compile them under IDEA?

Thanks,
Massimo

4 comments

I know this is a year after the fact, but can you please elaborate on how you solved this?

0

First of all, unzip the "OpenCV-2.4.9-android-sdk" (use the version you prefer) into a folder.
Open up inside IntelliJ the android sample you want to compile with OpenCV.

Then go to File->Import module

and select "OpenCV-2.4.9-android-sdk\sdk\java" folder.
Select "Import module from external model" with Eclipse option.

This will import module inside your project. Now you need to tell Intellij that your project depends on the OpenCV library.

To do so, go to File->Project structure..
Under Project Settings Tab, select Modules, than select your sample project. Than on the "Dependencies" tab of your project, press the green arrow on the right (Add), than add Module dependencies.

On the window that appears, just select the newly imported "OpenCV library 2.4.9" and that's it.

0

Hi,

Did everything as you wrote, does not work.

What's my mistake?

Thanks.

1

Please sign in to leave a comment.