Thanks to this answer, it looks there is something changed in opencv 4 so that all existing tutorials talking about importing java folder as module, while actually the one required to be imported is the skd folder itself.
You can use JavaCV that is a wrapper of OpenCV, or do OpenCV manually as below:
1- From here download OpenCV – 4.1.1 for Android
2- Extract the folder, it will be extracted to OpenCV-android-sdk, that contains the following:
Hasans-Air:OpenCV-android-sdk hasan$ ls
LICENSE README.android samples sdk
3- Head to your project at Android Studio
4- File -> New -> Import Module
5- Select the sdk folder in the extracted folder in point 2, as shown the proposed module name is :sdk but you can rename it like :sdkOpenCV4, do not forget the : in front of the name

6- Right click the app, select Open Module Settings, select Dependencies, then click the app module, in the Declared Dependencies tap click + then you'll see the OpenCV module there, click add it, click Apply then Add:




7- From OpenCV SDK copy the sdk/native/libs folder, and go to tour application folder src/main and paste it inside it, then rename the libs folder to jnilibs, so that in your application src/main folder
you'll be having:

8- In the OnCreate you can add a check before start using it:
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val ocvLoaded = OpenCVLoader.initDebug()
if (ocvLoaded) {
Toast.makeText(
this@MainActivity, "OpenCV loaded",
Toast.LENGTH_SHORT
).show()
} else {
Toast.makeText(
this@MainActivity, "Unable to load OpenCV",
Toast.LENGTH_SHORT
).show()
Log.d("openCV", "loader: ${OpenCVLoader.initDebug()}")
}
}
}