'Importing Module in Android Studio

How can I import an external module (named ViewPagerIndicator) in Android Studio?



Solution 1:[1]

To import an existing Java library to an android project. Do the following.

enter image description here

Then select your Java library.

Solution 2:[2]

  1. Click on File and select Import Module option.
  2. Open of select your ViewPagerIndicator module from local.
  3. add compile project(path: ':ViewPagerIndicator') in your gradle file.

Solution 3:[3]

This tutorial will help you to do easily that without any code in build.gradle (actually system will do code for you).

Solution 4:[4]

I was also facing the same issue. Please make sure below steps

1)build.gradle :-
     implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(path: ':<Project-name>')

2) settings.gradle
     include ':<Project-name>'

Solution 5:[5]

  1. Go to File > New > Project Structure
  2. In the left you see Dependencies, click on it
  3. All Modules need to be chosen
  4. Click + and Library Dependency
  5. Search module that you need

Solution 6:[6]

In case you have a module in your android project called library for example, and you want to add this module as a library to another module called app for example, in that same android project, here's what just worked for me, add this inside your app module's build.gradle:

dependencies {
    implementation project(path: ':library')
}