2016-12-28 6 views
0

일부 파일을 검색하려고 할 때 Android에 UnauthorizedAccessException이 있습니다. 이상한 일은 오늘 저녁에 몇 달 전부터 일했다는 것입니다.UnauthorizedAccessException on android

  • 은 구글이 서비스
  • 플레이 테스트 알파를 사용하려면 APK를 업로드 :

    유일한 일이 나는 시간의 지난 몇이 (내가 어떻게 변경되었을 수 있습니다 아무것도 볼 수없는 경우에도)했다

  • 키 스토어를 추가하고 응용 프로그램을 서명 내 테스트 장치에 내 응용 프로그램의 마지막 인스턴스를 제거
  • (서명 된 버전과 호환되지 않습니다)

다음은 (아무 서명, 같은 문제로 시도) pp는 Unity 5.5.0f3으로 제작되었으며, 나는 접근하려고하는 경로를 빌드하기 위해 Application.persistentDataPath을 사용합니다. StateMachine.Start에서

UnauthorizedAccessException: Access to the path "/storage/emulated/0/Android/data/com.<mycompany>.<myproductname>/files/Saves" is denied. 
at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x00000] in <filename unknown>:0 
at System.IO.Directory.GetFiles (System.String path, System.String searchPattern) [0x00000] in <filename unknown>:0 
at System.IO.Directory.GetFiles (System.String path, System.String searchPattern, SearchOption searchOption) [0x00000] in <filename unknown>:0 
at ProfileManager.ParseDirForProfiles (.DirName _dir, .FileExtension _ext) [0x00000] in <filename unknown>:0 
at SaveManager.ParseDirForProfiles() [0x00000] in <filename unknown>:0 
at myproductname.OnStart() [0x00000] in <filename unknown>:0 

()은 0x00000]에서 : 0 CallStack

코드 일으키는 문제점 : Code

하고 여기

예외위한 호출 스택 인 관련 설정 : Settings 1 Settings 2

답변

1

이전 버전의 호환되지 않는 버전의 응용 프로그램이 계속 디렉토리를 소유 할 수 있습니다. 디렉토리를 삭제하고 다음에 실행할 때 디렉토리를 재 작성하십시오.

앱이 정상적으로 업데이트되면 이러한 종류의 문제가 발생하지 않습니다.

+0

대단히 고맙습니다. 내 문제를 해결했습니다. 가능한 빨리 답변을 수락하겠습니다. –