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.
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.
The best way to fix the .iml files (by recreating them) is to do this:
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.
The best way to fix this problem is:
Go to Tools-> Android -> Sync Project with Gradle Files
That works for me.
This is because of .iml file conflict, For fixing the issue you just need to clean the project and rebuild.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With