Import source code module in Android Studio is not working

Viewed 1286

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

2 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.

I also had the same problem. No action worked. I was able to solve it by installing an older version from here. (Android Studio 4.2.2) Then I upgraded to the newest version again.

Android Studio Old Versions

Related