개발일지

[Unity]Firebase storage 에서 local 파일로 assetbundle 다운받기 중 에러

훗냥이 2022. 12. 5. 19:22
728x90

에러메세지

2022-12-05 18:47:56.003 14080-14433/? E/StorageException: StorageException has occurred.
An unknown error occurred, please check the HTTP result code and inner exception for server response.
Code: -13000 HttpResult: 0
2022-12-05 18:47:56.003 14080-14433/? E/StorageException: StorageException has occurred.
An unknown error occurred, please check the HTTP result code and inner exception for server response.
Code: -13000 HttpResult: 0
2022-12-05 18:47:56.004 14080-14433/? E/AndroidRuntime: FATAL EXCEPTION: FirebaseStorage-Download-2
Process: com.factory608.ME, PID: 14080
java.lang.NullPointerException
at java.io.File.<init>(File.java:283)
at com.google.firebase.storage.FileDownloadTask.processResponse(FileDownloadTask.java:131)
at com.google.firebase.storage.FileDownloadTask.run(FileDownloadTask.java:228)
at com.google.firebase.storage.StorageTask.lambda$getRunnable$7$StorageTask(StorageTask.java:1072)
at com.google.firebase.storage.-$$Lambda$StorageTask$_IQT0HwL0SAn4-mUxblkILcDlBo.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)


에러메세지 레퍼런스를 보면
https://firebase.google.com/docs/reference/unity/class/firebase/storage/storage-exception#class_firebase_1_1_storage_1_1_storage_exception_1a6325f13b8c24f6380f533e40eb0773ea

Firebase.Storage.StorageException Class Reference

firebase.google.com


빨간색으로 표시한 에러가 UnKnownError 라고 뜸 어이없음 ???

해결

string PathSt = "";
#if UNITY_EDITOR
PathSt = Path.Combine(Application.streamingAssetsPath);
#else
PathSt = Application.persistentDataPath;
#endif

유니티에디터랑 모바일에서의 로컬파일 저장 경로를 다르게 설정해줘야 함.
Set different saving local path for build version
처음부터 레퍼런스에 이렇게 써놓으라고요.
Couldn't  they just write it on the reference together?

언젠가 빌드해야할 프로젝트인데 유니티용만 써놓으면 어떡하냐고


일단 안드로이드 빌드 성공했고 iOS 는 내일 되는지 확인하기로.

728x90