본문 바로가기
프로그래밍/Android

[Android] java.lang.AssertionError: Could not delete caches dir

by Youngs_ 2022. 7. 26.

빌드시 아래와같은 형식으로 에러가 나오면서 빌드가 안될때가 있는데 invalidate & restart를 해도 안되고 프로젝트를 clean을 해도 동일한 에러가 나올때가 있다.

필자는 Java 코드를 Kotlin으로 변환시킬때 에러가 나왔는데 정확히 어떨때 에러가 나오는지는 모르겠다..

java.lang.AssertionError: Could not delete caches dir
 > D:\project\workspace\프로젝트 이름\app\build\kotlin\kaptGenerateStubsDebugKotlin

 

위와같은 에러가 나올때는 java.exe를 종료해야하는데

cmd창을 연 후에 아래와같이 명령어를 입력해야한다.

-> 윈도우기준, Linux 등 다른 운영체제는 java.exe 프로세스를 종료할수있는 명령어를 검색후 실행하자

taskkill /IM java.exe /F

 

 


출처 

https://stackoverflow.com/questions/65832868/caused-by-java-lang-assertionerror-could-not-delete-caches-dir-yourproject-bui

 

Caused by: java.lang.AssertionError: Could not delete caches dir yourProject\build\kotlin\compileDebugTestingKotlin

Sometimes this unexpected message appear and the only way to deal with this is to restart the pc and when it starts again go to the obove path and delete the file before start Android Studio with the

stackoverflow.com

https://www.youtube.com/watch?v=RDM0EBaWPBQ 

https://tzara.tistory.com/104

 

Windows에서 java 프로세스 강제 종료

Windows 에서 Logstash 프로세스를 중단시키는 스크립트 짜던 김에 간단히 정리. 실행 중인 java 애플리케이션을 강제 종료하려면 다음과 같은 방법으로 간단히 되지 않을까 싶다. C:>taskkill /IM java.exe /

tzara.tistory.com

 

댓글