Importing Module in Android Studio

Importing Module in Android Studio

Steps to import Module in Android Studio 3.3 and lower.

  1. Go to File >> New >> Import Module...
  2. Select the source directory of the Module you want to import and click Finish.
  3. Open Project Structure and open Module Settings for your project.
  4. Open the Dependencies tab.
  5. Click the (+) icon and select Module Dependency. Select the module and click Ok.
  6. Open your build.gradle file and check that the module is now listed under dependencies.implementation project(path: ':ViewPagerIndicator')

Steps to import Module in Android Studio 3.4 and higher (See attached
image).

  1. Go to File >> New >> Import Module...
  2. Select the source directory of the Module you want to import and click Finish.
  3. Open Project Structure Dialog (You can open the PSD by selecting File > Project Structure) and from the left panel click on Dependencies.
  4. Select the module from the Module(Middle) section In which you want to add module dependency.
  5. Click the (+) icon from the Declared Dependencies section and click Module Dependency.
  6. Select the module and click Ok.
  7. Open your build.gradle file and check that the module is now listed under dependencies.implementation project(path: ':ViewPagerIndicator')
    Sample Image

Can't import module in Android Studio Arctic Fox

[ Fixed ] in Android Studio Bumblebee (2021.1.1)

This issue was fixed in Android Studio Bumblebee. Please Update Android Studio to Bumblebee or Latest Version



This Bug is in Android studio Arctic Fox,

Many people are posted this issue on issuetracker but nobody get solution from Android studio team side.
here is some links of that issues posted on issuetracker.

Link 1 ,
Link 2 ,
Link 3 ,
Link 4 ,
Link 5 ,
Link 6 ,
Link 7

So here is Temporary Workaround

  • copy your-module folder in your project directory

  • Add below line in settings.gradle

    include ':your-module' // your-module is module name 
  • click sync now

  • Done

How to import module into Android Studio?

If you want to add android library as ".aar" file, you can find adding module option in Android Studio toolbar.

Sample Image

I can't Import Module from Source, The Finish button is off

it is a bug in android studio arctic fox.
Google didn't response with any solution but for now you can do:

 1. copy your-module folder in your project directory.
2. Add below line in settings.gradle.
3. include ':your-module' // your-module is module name.
4. click sync now


Related Topics



Leave a reply



Submit