Android Studio Gradle Already disposed Module

前端 未结 17 1504
一个人的身影
一个人的身影 2020-12-04 04:58

I have installed Android Studio version 1.0.1. I have imported my projects from eclipse and it works fine. Then I deleted a module and reimported it into my Android Studio p

相关标签:
17条回答
  • 2020-12-04 05:39

    I had the same problem, after delete some gradle files (of aws)

    i solved it by mark them "ignore gradle"

    I believe it is not the best answer but it solve it for me

    Gradle (at the right bar)--> right click on the problematic gradle --> ignore

    0 讨论(0)
  • 2020-12-04 05:42

    I figured out this problem by:

    1. ./gradlew clean
    2. Restart Android Studio
    0 讨论(0)
  • 2020-12-04 05:42

    Although the accepted answer didn't work for me (unfortunately I can't leave a comment), it led me in the right direction.

    in .idea/libraries i found that there were some duplicate xml files (the duplicates were named with a 2 before the _aar.xml bit).

    deleting those, restarting android studio and sync fixed the error

    0 讨论(0)
  • 2020-12-04 05:45

    Note: this is purely an IDEA/AS issue, gradlew clean | Build > Clean | Build > Rebuild will just waste your time.

    Most of the solutions here are blind stabbings in the dark. Here's what I found to be the root cause:

    1. Some of the .iml files may be missing (maybe because we deleted it), check if the module erroring has .iml.
    2. If it is missing, check if .idea/modules.xml has an entry for that module

    While syncing I noticed that IDEA/AS tries to put a new duplicate entry into .idea/modules.xml while there's already one. This duplicate entry is probably disposed of twice while the sync tries to reset the modules in memory.

    Quick Solution: In order to make it work the easiest is to delete .idea/modules.xml along with the .iml files. Additionally may worth deleting .idea/modules/ folder if it exists. Restart Android Studio (no need to clear cache) and force a Gradle sync from Gradle view or toolbar to recreate the files.

    0 讨论(0)
  • 2020-12-04 05:45

    works for me: File -> Invalidate Caches / Restart... -> Invalidate and Restart

    0 讨论(0)
  • 2020-12-04 05:46

    For me this happened when i deleted a module and built a new one with the same package name Solution:

    Clean & Restart Studio

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