1

I am trying to add module in my main app but its not showing in select section.I am using android studio 3.4.1

Android Root Directory

Android Root

gradle setting

gradle setting

Module dependency enter image description here

Ahmed Mujtaba
  • 744
  • 5
  • 16

1 Answers1

5

I was getting the same issue with Android Studio 3.6.3. The main issue is that the module you imported is registered as an "application" and not as a "library". And it seems only libraries can be imported. Here is what I did to resolve it.

Following the android documentation here:

  1. Open your module's (openCVLibrary441 in your case) build.gradle
  2. Change apply plugin: 'com.android.application' to apply plugin: 'com.android.library' at the top of your file.
  3. Delete the line applicationId in the defaultConfig {} as only an Android app module can define this.
  4. Now you should be able to see the module in the module dependency option. Optionally, you can add it manually in you app's build.gradle by adding implementation project(':openCVLibrary441') in the dependencies {} section.
  5. Sync your gradle files and you should be ready to go.