티스토리 뷰
Stack Overflow에 자주 검색, 등록되는 문제들과 제가 개발 중 찾아 본 문제들 중에서 나중에도 찾아 볼 것 같은 문제들을 정리하고 있습니다.
Stack Overflow에서 가장 먼저 확인하게 되는 가장 높은 점수를 받은 Solution과 현 시점에 도움이 될 수 있는 가장 최근에 업데이트(최소 점수 확보)된 Solution을 각각 정리하였습니다.
아래 word cloud를 통해 이번 포스팅의 주요 키워드를 미리 확인하세요.
Android Studio Gradle Already disposed Module
Android Studio Gradle 이미 삭제된 모듈
문제 내용
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 project. The gradle build says "BUILD SUCCESSFUL" but it pops up an alert window with the message
Android Studio 버전 1.0.1을 설치했습니다. 이클립스에서 프로젝트를 가져왔는데 잘 작동합니다. 그런 다음 모듈을 삭제하고 Android Studio 프로젝트로 다시 가져왔습니다. Gradle 빌드에 "BUILD SUCCESSFUL"이라고 표시되지만 메시지와 함께 경고 창이 나타납니다.
Failed to complete Gradle execution. Cause: Already disposed: Module: 'MYMODULENAME'
그래들 실행을 완료하지 못했습니다. 원인: 이미 삭제됨: 모듈: 'MYMODULNAME'
I can't start my app now. Any idea what I can do?
지금 앱을 시작할 수 없습니다. 제가 뭘 할 수 있을까요?
Edit: I solved the problem with the following instructions:
편집: 나는 다음 지침으로 문제를 해결했습니다.
- Switch project view from Android to Project
- Remove entry include 'MYMODULENAME' in settings.gradle
- The blue box in the module symbol don't show. Then you can delete the module in the context menu
- Import the module
1. 프로젝트 뷰를 Android에서 Project로 전환
2. settings.gradle에 'MYMODULNAME'이 포함된 항목을 제거합니다.
3. 모듈 기호의 파란색 상자가 표시되지 않습니다. 그런 다음 상황에 맞는 메뉴에서 모듈을 삭제할 수 있습니다.
4. 모듈 가져오기
높은 점수를 받은 Solution
Note: this is purely an IDEA/AS issue, gradlew clean
| Build > Clean | Build > Rebuild will just waste your time.
참고: 이것은 순전히 IDEA/AS 문제입니다. gradew clean | Build > Clean | Build > Rebuild는 당신의 시간을 낭비할 뿐입니다.
Most of the solutions here are blind stabbings in the dark. Here's what I found to be the root cause:
대부분의 해결책은 어둠 속에서 맹목적으로 찌르는 것입니다. 제가 발견한 근본 원인은 다음과 같습니다.
- Some of the
.iml
files may be missing (maybe because we deleted it), check if the module erroring has.iml
. - If it is missing, check if
.idea/modules.xml
has an entry for that module
1. .iml 파일 중 일부가 누락되었을 수 있습니다(삭제했기 때문일 수 있습니다). 모듈 오류에 .iml이 있는지 확인하세요.
2. 누락된 경우 .idea/modules.xml에 해당 모듈에 대한 항목이 있는지 확인하세요.
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.
동기화하는 동안 IDEA/AS가 .idea/modules.xml에 이미 중복된 항목이 있을 때 새 중복 항목을 넣으려고 한다는 것을 알았습니다. 이 중복 항목은 동기화가 메모리의 모듈을 재설정하려고 시도하는 동안 아마도 두 번 삭제됩니다.
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.
신속한 솔루션: 가장 쉽게 작동하려면 .iml 파일과 함께 .idea/modules.xml을 삭제하는 것이 좋습니다. 또한 .idea/modules/폴더가 있는 경우 삭제할 가치가 있습니다. Android Studio를 다시 시작하고(캐시를 지울 필요 없음) Gradle 보기 또는 도구 모음에서 Gradle 동기화를 수행하여 파일을 다시 만듭니다.
가장 최근 달린 Solution
Sometimes gradlew clean
or Invalidate Cache and Restart
does not help, because these methods do not clean Android Studio specific files by themselves.
이러한 방법은 Android Studio의 특정 파일을 자체적으로 치료하지 않기 때문에 gradew clean 또는 Invalidate Cache and Restart가 도움이 되지 않는 경우가 있습니다.
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.
이 경우 AS를 닫고 settings.gradle 파일이 있는 루트 프로젝트에서 .idea 디렉터리 및 .iml 파일을 제거하십시오. 이렇게 하면 AS가 새로운 영역에서 재구축됩니다.
출처 : https://stackoverflow.com/questions/27541838/android-studio-gradle-already-disposed-module
'개발 > 안드로이드' 카테고리의 다른 글
당겨서 새로고침 구현하기 (0) | 2022.12.17 |
---|---|
한 액티비티에서 다른 액티비티로 데이터(객체) 전달하기 (0) | 2022.12.17 |
액티비티 타이틀 바 숨기는 방법 (0) | 2022.12.16 |
'Error type 3 Error: Activity class {} does not exist' 오류 수정하기 (0) | 2022.12.16 |
AlertDialog 테마 변경하기 (0) | 2022.12.16 |