Home » Android » android – Unable to find module with Gradle path. Linking to library -unspecified instead

android – Unable to find module with Gradle path. Linking to library -unspecified instead

Posted by: admin April 23, 2020 Leave a comment


Update 2 This has been fixed in Android Studio 1.2 Beta 3

Update: This has reportedly been fixed in an upcoming release of Android Studio.

In Android Studio 1.2 Beta 2 I started getting the following warnings when syncing Gradle.

Failed to set up dependencies
Warning:Unable to find module with Gradle path ':Library1'. Linking to library 'Library1-unspecified' instead.
Warning:Unable to find module with Gradle path ':Library2'. Linking to library 'Library2-unspecified' instead.

I’ve noticed that jumping to a declaration declared in one of the library modules pulls up the Decompiler instead of just going to the actual source in the library module.

In my Android Studio Project I have the following modules:

- App
- Library1
- Library2

Module: App build.gradle snippet:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':Library1')
    compile project(':Library2')

settings.gradle file:

include ':App'
include ':Library1'
include ':Library2'
project(':Library1').projectDir = new File(settingsDir, '../library1/lib')
project(':Library2').projectDir = new File(settingsDir, '../Library2/lib')
How to&Answers:

It is a known bug introduced in 1.2 Beta 2.

See This issue on the Android issue tracker. Fix should be out within hours.


I faced this with Android Studio 2.2.3. The problem was with the .iml file that was causing the problem.

After importing the module folder into the project directory and adding the changes to include module in settings.gradle, delete the .iml file from the module folder and do a Gradle Sync. Then right click on any module in the Project Window and click on “Configure Project Subset…”, if the imported module is not checked, check it and Android Studio should do a Gradle Sync. By then the imported module will appear in the Project Window and will have a .iml file regenerated that is does not cause any issues.


  1. delete the .iml file under the error module.
  2. restart Android studio


Right click project, Select “Configure Project Subset …” and select your module, rebuild your project.


I met the same problem on AS 2.0 preview,
and I fixed it by following steps:

1.Rename the module.
2.Change the names in app/build.gradle and setting.gradle.
3.Start gradle sync.

I don’t know why but it works on my issue.


If you are using React-native>60, then you should run npx jetify on root of your project before doing Gradle sync.


For me the following worked in Android Studio 3.5.3

First of all, check if the path is correct in your Gradle settings.

If the path is correct then invalidate caches & restart by navigating to the top ‘File’ menu


Check in settings. of your app.
Down there is the field “Load/Unload Modules”

Your module might be unloaded, that’s why Android Studio ignores it even if you specify it in Gradle.

At least that was the problem for me.

enter image description here


I had this problem and solved it by clicking on

File> Ivalidate cache / Restart…

as shown below:

print android Studio



This problem can also occur when you change the path to the module.


include ':app', ':filechooserlibrary'
project(':filechooserlibrary').projectDir = new File('../../repos-github/file-chooser/file-chooser-library/filechooserlibrary')

I changed the path to '../../github/file-chooser/file-chooser-library/filechooserlibrary'

The old path did not exist any more. But then, instead of accepting the new path, Android Studio recreated the old path structure thus referring to an empty directory.

So, I deleted this obsolete path structure and restarted Android Studio, after deleting the .iml file (I don’t know if this is necessary, but it cannot do harm). Then I reimported the Gradle project and it worked.