===== 1. 문제점 ===== 기존 Android 10(Q, API Level 29)까지는 WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE 권한이 있다면 자유롭게 미디어에 대한 읽기/쓰기 처리가 가능했다. 즉, AndroidManifest.xml에 와 같이 권한을 허락해 주면, 다음과 같은 파일 읽기 함수를 마음대로 쓸 수 있었다. val dir = File(Environment.getExternalStorageDirectory().toString() + "//Documents") val files = dir.listFiles() if (files == null) { println("There are no files!! ") }else{ val numberOfFiles = files.size println("The are $numberOfFiles files in this directory!") println("The directory is $dir") } ===== 2. 해결법 ===== ==== 가. 레거시 코드 허용해 주기 ==== [[https://stackoverflow.com/questions/37819550/java-io-filenotfoundexception-storage-emulated-0-new-file-txt-open-failed-ea|Scoped Storage stackoverflow 이슈]] 다음의 코드를 Manifest.xml에 넣어주면 레거시 코드로 스토리지 접근이 가능하다. android:requestLegacyExternalStorage="true" 위치는 application tag이다. ==== 나. 미디어 스토어 이용하기 ==== [[https://medium.com/hongbeomi-dev/android-11-scoped-storage-%EB%8C%80%EC%9D%91%ED%95%98%EA%B8%B0-6b4319cfac19|한국 사람의 블로그]]