1

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.

Dan
  • 12,857
  • 7
  • 40
  • 57
  • What do you mean "add to Android Studio"? How are you doing that? You could just manually edit the settings.gradle file to include projectB – OneCricketeer Apr 08 '18 at 18:54
  • So I've tried adding it via the settings.gradle and also via the File>New>Import Module dialog. Both seem to have the same effect. – Dan Apr 08 '18 at 18:58
  • Hmm. I assume the other project has a lot of dependencies? – OneCricketeer Apr 08 '18 at 19:03
  • `projectB` depends on Spring Boot (and thus Jackson) but that's it. Like I say, it seems to get stuck looping through a few files. By which I mean if I watch the file name under the progress bar it just cycles. Though each time I invalidate the cache it seems to cycle through a different few. – Dan Apr 08 '18 at 19:04
  • Might be worth upgrading the Gradle plugin / wrapper – OneCricketeer Apr 08 '18 at 19:07
  • How does one do that? I'm currently using the "default gradle wrapper". Gradle seems to be version 4.4 and I'm using Android Studio 3.1. – Dan Apr 08 '18 at 19:09
  • I think that's the latest, but you can check https://developer.android.com/studio/releases/gradle-plugin.html – OneCricketeer Apr 08 '18 at 19:16

1 Answers1

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.

Dan
  • 12,857
  • 7
  • 40
  • 57