Android Studio “Scanning For Files To Index”

2019-08-27 15:33发布

问题:

I am trying to achieve the following project structure in Android Studio

project/
    projectA/
    projectB/

Where projectA is an "app" module created by Android Studio which I have renamed, and projectB is a Kotlin project I wish to depend on in the app. I can get the projects to appear correctly as modules in my project however no matter what I try, as soon as I add projectB to my Android Studio project, it seems to get stuck in a loop "searching for files to index". When I look at the files it is always just looping through the same 2-3 files. They are always META-INF files but not always the same ones.

How do I successfully add a module to an Android Studio Project without hitting this error or how can I set out my project from the start to achieve this structure?

Thanks.

回答1:

The problem seemed to be that I had a gradle/ directory under my project/projectB directory that was there because the project was originally created as a standalone project by IntelliJ. Deleting that fixed the issue.