반응형
macOS에서 Android Studio 빌드 시 '._drawable' is not a directory 오류 해결하기
안드로이드 스튜디오에서 MacOS를 사용하여 빌드할 때 '.drawable' is not a directory 오류가 발생하는 경우, 이는 MacOS가 생성하는 불필요한 '.'로 시작하는 파일로 인해 발생합니다.
이러한 파일은 리소스 디렉토리에 영향을 주어 빌드 오류를 유발할 수 있습니다.
이 문제를 해결하기 위해 다음과 같은 방법을 사용할 수 있습니다:
- 터미널 명령어를 사용하여 '._' 파일 삭제하기: 프로젝트 디렉토리에서 터미널을 열고 다음 명령어를 실행하여 모든 '._'로 시작하는 파일을 삭제합니다:
- find . -name '._*' -exec rm -rf {} +
또는, 'dot_clean' 명령어를 사용하여 해당 디렉토리의 불필요한 파일을 정리할 수 있습니다:
dot_clean .
이러한 방법으로 숨김 파일을 제거한 후, 안드로이드 스튜디오에서 다시 빌드를 시도해 보세요.
- MacOS의 '._' 파일 자동 생성 방지 설정: MacOS는 네트워크 드라이브나 비 MacOS 파일 시스템에 접근할 때 '._' 파일을 자동으로 생성합니다. 이를 방지하기 위해 터미널에서 다음 명령어를 실행하여 해당 설정을 변경할 수 있습니다:
- defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
명령어 실행 후 시스템을 재시작하면 설정이 적용됩니다.
이러한 조치를 통해 '._drawable' is not a directory 오류를 해결하고, 안드로이드 스튜디오에서의 빌드 문제를 방지할 수 있습니다.
[Eng]
Resolving the '._drawable' is not a directory Error in Android Studio on macOS
When building Android projects on macOS, you might encounter the following error:
'._drawable' is not a directory
```
This issue arises due to macOS creating hidden files prefixed with '._' (e.g., '._drawable') when copying files to non-native file systems or external drives. These files can interfere with Android Studio's build process.
### Solution 1: Remove '._' Files Using Terminal
To delete all '._' files in your project directory, open Terminal and navigate to your project folder. Then, execute:
```bash
find . -name '._*' -exec rm -rf {} +
```
Alternatively, you can use the `dot_clean` command to merge and remove these hidden files:
```bash
dot_clean .
```
After cleaning, rebuild your project in Android Studio.
### Solution 2: Prevent Creation of '._' Files
To stop macOS from generating '._' files on network drives or non-native file systems, run:
```bash
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
```
Then, restart your system for the changes to take effect.
By following these steps, you can resolve the '._drawable' is not a directory error and ensure a smoother development experience on macOS.
---
**블로그 게시글 제목 (한글):**
macOS에서 Android Studio 빌드 시 '._drawable' is not a directory 오류 해결하기
**태그:**
Android Studio, macOS, 빌드 오류, Drawable 폴더, 숨김 파일, dot_clean, find 명령어, 안드로이드 개발
---
## macOS에서 Android Studio 빌드 시 '._drawable' is not a directory 오류 해결하기
macOS에서 Android 프로젝트를 빌드할 때 다음과 같은 오류가 발생할 수 있습니다:
'._drawable' is not a directory
반응형
'Development Solutions > Android' 카테고리의 다른 글
[Android][3분 컷] 조치 필요: 앱이 Google Play 정책을 준수하지 않음 (0) | 2023.10.22 |
---|---|
[Solution][Android] 'com.example'은(는) 제한되어 있으므로 다른 패키지 이름을 사용해야 합니다. [1분 해결 방법] (0) | 2023.10.16 |
[Android Studio][Mac] 유용한 단축키 모음 (0) | 2023.01.21 |