IntelliJ and Android Gradle dependencies - unable to find module

前端 未结 4 2044
没有蜡笔的小新
没有蜡笔的小新 2021-01-01 21:12

I have following directory structure:

D:\\PROJECT  
+---javaGradleProject1  
+---javaGradleProject2  
+---javaGradleProject3  
\\---AndroidProject  
    |          


        
相关标签:
4条回答
  • 2021-01-01 21:39

    I was able to solve this by deleting the settings.gradle file from every Gradle project that I wanted to use as dependency (clearing the contents of this file was not enough).

    NOTE: As I have little knowledge of Gradle and Android Studio, I cannot provide information about why the presence of this file does not allow Android Studio to include the Gradle project as a module.

    0 讨论(0)
  • 2021-01-01 21:48

    Right click project, Select

    "Configure Project Subset ..."

    and select your module, rebuild your project.

    0 讨论(0)
  • 2021-01-01 21:53

    In my case I had to change the external module name to lowercase only.

    0 讨论(0)
  • 2021-01-01 22:01

    Add a colon (:) before the names of your modules when you add it in settings.gradle, e.g. for the first one, change this:

    include 'javaGradleProject1'
    project(':javaGradleProject1').projectDir = new File(rootDir, '../javaGradleProject1')
    

    to this:

    include ':javaGradleProject1'
    project(':javaGradleProject1').projectDir = new File(rootDir, '../javaGradleProject1')
    

    Now in addition to compiling, IntelliJ / Android Studio should give you code completion.

    0 讨论(0)
提交回复
热议问题