Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import source code module in Android Studio is not working

I'm writting an application where I need to import another liberary project. But when I'm doing that it is just not allowing to import that. please refer snap.

I have followed to choose File -> New -> Import Module.. -> Browse Module Path. Any suggestion what could be possible issue here ?

enter image description here

like image 894
CoDe Avatar asked Aug 03 '20 10:08

CoDe


People also ask

How do I import a module into gradle?

In Android Studio, Right-clicking on the folder to add as library. Editing the dependencies in the build. gradle file, adding: compile fileTree(dir: 'libs', include: '*. jar')}


1 Answers

what I did to import my Wear OS module into the main app project, knowing that the straight module import functionality was just not working (the Finish button was greyed out despite the module name to import showing correctly, and being different to the main module name)

  1. refactor the Wear OS module name inside its own project in case it has the same name as the main module name in the target project (such as 'app', initially), to something like "appwearos"
  2. in the target project (the one you want to import TO), create a brand new module, with the same name as the module you want to import
  3. replace the content of the new module's manifest with that of the module you wanted to import
  4. close your projects, and copy the contents of the src folder of the module you want to import into the src folder of the newly created module, in the target project
  5. open your target project, and voila!

Also make sure that the package names are the same across modules.

like image 86
Razvan_TK9692 Avatar answered Sep 27 '22 20:09

Razvan_TK9692