Hi guys,
I have not been so frustrated in long time. After a full day, I am still unable to compile an hello world in Android.
OpenCV for android 4.7.0 as downloaded
Android Studio Flamingo | 2022.2.1
Installed multiple SDK version, SDK built tools, NDK, command line tools, platform tools + some irrelevant extras.
Successfully tested a simple camera capture program using only android (not opencv).
Followed the tutorial:
However, I am unable to get it compiled:
error: package org.opencv.engine does not exist
import org.opencv.engine.OpenCVEngineInterface;
I found hundred of “solutions” on the internet. NONE of them works.
Ended up copying all the opencv java into the project,
i have the whole org/opencv/ tree in main, i have added the jniLibs folder, fixed version inconsistencies in gradle files etc…
Still, nothing works.
I was assuming that maybe I need to compile the opencv sdk.
Attempting to import the opencv/sdk in Android Studio to see if it compile. It does not:
A problem occurred evaluating root project ‘sdk’.
Plugin with id ‘com.android.library’ not found.
Questions:
The android packet is ready to go or need compiled ?
How to get OpenCV to compile in Android Studio, if this is the problem?
If no, any hints to alleviate a nerve-racking experience ?
You could have a try to add “android.defaults.buildfeatures.aidl=true” to the gradle.properties. to enable the aidl buildfeature.
ref: BuildFeatures | Android Developers