본문 바로가기
Android/Build Error

[Android] CMake clean 오류 (CreateProcess error=2 지정된 파일을 찾을 수 없습니다)

by Jay Son 아기 냥이 해린 짱💖 2021. 6. 29.

현상 : CMake사용하는 프로젝트 Android Studio Clean 실행 할 경우 에러 발생

원인 : CMake 경로가 잘못 지정되어 있음.

수정 : .externalNativeBuild 폴더 삭제

 

1. 에러 메시지

  - 아래와 같이 이전에 사용했던 Android SDK 경로를 참조 하고 있음.

     > C:\Users\json\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe

Executing tasks: [clean] in project D:\Works\JsonProject

> Task :clean UP-TO-DATE

> Task :app:externalNativeBuildCleanDebug FAILED
Clean opensl, ffmpeg
Cleaning... 0 files.
Clean opensl, ffmpeg

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:externalNativeBuildCleanDebug'.
> A problem occurred starting process 'command 'C:\Users\json\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
2 actionable tasks: 1 executed, 1 up-to-date

   - 현재 cmake.exe 파일은 아래와 같이 sonxx 폴더에 설치 되어 있음.

2. 해결 방법

   - Project -> app -> .externalNativeBuild 폴더 삭제

   - 과감하게 삭제하자

3. 결과

   - clean 성공

빌드 오류 원인은 다양하기 때문에 위 방법으로 해결되지 않을 경우 다른 원인을 찾아 해결해야 합니다.

반응형