Android Studio Gradle Already disposed Module

前端 未结 17 1503
一个人的身影
一个人的身影 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:46

    For me this happened when I removed a module and tried to build the project:

    Simple solution was to Invalidate the cache & Restart.

    Android Studio>File>Invalidate Caches>Invalidate & Restart

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

    For an alternative solution, check if you added your app to settings.gradle successfully

    include ':app' 
    
    0 讨论(0)
  • 2020-12-04 05:49

    Had a similar issue when working with RN components in my Android project and the only way to get around this issue was to ignore the gradle project.

    To do this:

    • Click on the gradle tab on the right hand side of AS
    • Right click the gradle module which is causing an issue
    • Click "Ignore Gradle Project"
    • Perform a gradle sync which should be successful now
    • If you need this module perform the 4 above steps again, this time when right click on the gradle project it'll show "Unignore Gradle Project"
    • Gradle sync should now work

    No idea what causes this but I've had this happen to me when using React Native Maps.

    Note: If you're still having issues following this. Try to refresh the gradle project which was causing issues.

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

    Sometimes gradlew clean or Invalidate Cache and Restart does not help, because these methods do not clean Android Studio specific files by themselves.

    In this case, close AS and remove .idea directory and .iml file in a root project where settings.gradle file exists. This will make AS rebuild from the fresh ground.

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

    I was having this issue because gradle and Android Studio were using a different path for the jvm. In the Event Log there was an option for AS and gradle to use the same path. Selecting this and then doing an invalidate cache & restart resolved the issue for me.

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