Error: Unfortunately you can't have non-Gradle Java modules and > Android-Gradle modules in one project

前端 未结 25 2412
孤独总比滥情好
孤独总比滥情好 2020-12-12 10:29

I have an IntelliJ 14.1.2 Project consisting of two modules - one is an Android Gradle based module and the other is a Spring Java-based module with Maven.

gps-track

相关标签:
25条回答
  • 2020-12-12 10:52

    This solution worked for me Android Studio 3.3.2.

    1. Delete the .iml file from the project directory.
    2. In android studio File->invalidate caches/restart.
    3. Clean and Rebuild project if the auto build throws error.
    0 讨论(0)
  • 2020-12-12 10:53

    1- close the project

    2- close Android Studio IDE

    3- delete the .idea directory

    4- delete all .iml files

    5- open Android Studio IDE and import the project

    Answer from here

    0 讨论(0)
  • 2020-12-12 10:53

    None of above worked for me but tried something random and it worked.

    1. Copy the corrupted project directory.
    2. Paste it at somewhere else.
    3. Import it in Android Studio. (File-> New-> Import project)
    4. And uncorrupted project get restored.

    PS: You must have original corrupted project. (Means, copy it without tampering project structure)

    0 讨论(0)
  • 2020-12-12 10:54

    The ultimate solution to this error:

    SOLUTION 1

    Step 1 Go to File -> Invalidate Caches/Restart.

    Step 2 Close the project.

    Step 3 Go to project folder and delete .idea folder.

    Step 4 Delete YourProjectName.iml in project folder.

    step 5 You will see a folder below graddle folder, Delete YourProjectName folder (it contains another YourProjectName.iml file).

    Step 6 Open Android studio -> open existing project, and then select your project.

    **

    SOLUTION 2

    **

    Step 1: Open the Corrupted Project (The one showing error).

    Step 2: Open system.gradle file.

    step 3: add this line of code include ':app'.

    Step 4: click on the sync, to sync the gradle file.

    0 讨论(0)
  • 2020-12-12 10:57

    First of all you should update to Android Studio Source: https://code.google.com/p/android/issues/detail?id=77983

    Then you should go to File -> Invalidate Caches / Restart -> Invalidate Caches & Restart.

    Then try to build the application again.

    I found this answer here

    0 讨论(0)
  • 2020-12-12 10:57

    This may be resolved by fixing .idea/modules.xml
    Check for https://stackoverflow.com/a/61343944/11910757

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