With the version: Android Studio3.4.1, openCV 3.4.9
1. Download
In opencv official website to download the latest SDK package, I downloaded version is 3.4.9, extract after download is complete.
Download: https://opencv.org/releases/
2. Import
(1) Create a new Android project OpenCVTest, click on File-> New-> Import Module
The following interface
Import unzipped position opencv-3.4.9-android-sdk choose OpenCV \ sdk \ java folder, click OK
Click Finish
(2) Processing Warning
The following warning appears after clicking, because build.gradle information openCV inconsistent with the project lead.
Click openCVLibrary349, delete
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21" />
Synchronize again, successfully.
but
Under the version number in the version number of project needs and app / under build.grade into consistent, then sync again.
(3) Open the Android project OpenCVTest \ app \ src \ main folder, create a folder jniLibs, and the opencv-3.4.9-android-sdk \ OpenCV-android-sdk \ sdk \ native \ libs directory all copy the folder to just jinLibs folder.
(4) manually add dependencies
Add in the app / build.grade in the dependencies
api project(path: ':openCVLibrary349')
This configuration is complete it!