Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Each module has to have a unique path

I have imported a project from version control using GIT. After importing, syncing and all that, it gave me this error:

Error:The modules 'LinkedCraftMobile', 'linkedcraft_android' point to same directory in the file system. Each module has to have a unique path.

I wanted to have a module that can be updated directly with GIT using Android Studio.

like image 365
Compaq LE2202x Avatar asked Jul 28 '16 07:07

Compaq LE2202x


4 Answers

2016: It could be because of a .gitmodules including two entries with the same paths, but square/assertj-android issues 174 points out to another file:

This usually is the result of old iml files. Delete them all and re-import.

Weird, removing the .iml and reimporting worked.

Update 2020: as commented by ArashYounesi in issue 174, Android Studio V4.0 seems to resolve the problem.

like image 148
VonC Avatar answered Nov 03 '22 02:11

VonC


The best way to fix the .iml files (by recreating them) is to do this:

  1. Close the project in Android Studio
  2. In Android Studio, New > Import Project

That fixed it for me, and it was a lot easier than the other stuff I tried (and a lot less complex).

I believe that rewrites the .iml files with you do that.

What did I try? I tried Build > clean/rebuild project, File > Invalidate caches/restart, and Sync Project with Gradle Files. I was going to manually erase my .iml files but then I found out about this solution and it worked.

like image 33
codingjeremy Avatar answered Nov 03 '22 02:11

codingjeremy


The best way to fix this problem is:

Go to Tools-> Android -> Sync Project with Gradle Files

That works for me.

like image 2
Sayan Manna Avatar answered Nov 03 '22 00:11

Sayan Manna


This is because of .iml file conflict, For fixing the issue you just need to clean the project and rebuild.

like image 1
EKN Avatar answered Nov 03 '22 00:11

EKN