일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- 흙크루글쓰기클럽1기
- 깔끔한 꽃차 좋아
- 스마트 스토어 창업
- k.kakaocdn.net
- 유튜브준비중
- 매일글쓰기
- 생활환경안전정보시스템
- 네이버 스마트 스토어
- 빈속에 티라미슈는 무거워
- 안눕법 실
- 환경부 초록누리
- 전원 꽂을 곳이 있는 카페
- 초록누리 사이트
- 화이자3차접종
- 앱부업
- 글쓰기클럽
- 실발살균건조기
- 화이자 3차 후기
- 비오는날신발말리는방법
- 카카오뷰
- 카페 FLORA
- 본앤메이드
- 화이자 3차부작용
- 화이자3차접종간격
- 본앤메이드신발살균건조기
- 경기도청년면접수당모집
- 흙회장
- 본앤메이드사용설명서
- 카공족 인 척하는 아줌마
- 초록누리홈페이지
- Today
- Total
우물안에서 보는 하늘도 맑다
오틸라의 안드로이드 앱 만들기 강좌 : 힐링 #9 본문
* FIrebase Storage 시작
* Cloud Storage 개발자 문서
https://firebase.google.com/docs/storage?authuser=0
* 스토리지 업로드 방식 중, 메모리 데이터에서 업로드 방식을 선택함
* 이미지를 선택하지 않고 저장 버튼을 눌렀을 때, 오류 발생
Load failed for https://firebasestorage.googleapis.com/v0/b/agmhealing3.appspot.com/o?name=profile%2Filhot.jpg&uploadType=resumable&upload_id=AAANsUmoPKKUSR5zaL6S3LuQjiQPxMIKVo59yiIie3X_69GAuROJYDVObgoDnSRTHWDCeABoGBBtdGS_ZGCLJ-egsGM&upload_protocol=resumable with size [175x175] class com.bumptech.glide.load.engine.GlideException: Failed to load resource There was 1 cause: java.io.FileNotFoundException(https://firebasestorage.googleapis.com/v0/b/agmhealing3.appspot.com/o?name=profile%2Filhot.jpg&uploadType=resumable&upload_id=AAANsUmoPKKUSR5zaL6S3LuQjiQPxMIKVo59yiIie3X_69GAuROJYDVObgoDnSRTHWDCeABoGBBtdGS_ZGCLJ-egsGM&upload_protocol=resumable) call GlideException#logRootCauses(String) for more detail Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE There was 1 cause: java.io.FileNotFoundException(https://firebasestorage.googleapis.com/v0/b/agmhealing3.appspot.com/o?name=profile%2Filhot.jpg&uploadType=resumable&upload_id=AAANsUmoPKKUSR5zaL6S3LuQjiQPxMIKVo59yiIie3X_69GAuROJYDVObgoDnSRTHWDCeABoGBBtdGS_ZGCLJ-egsGM&upload_protocol=resumable) call GlideException#logRootCauses(String) for more detail Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed There was 1 cause: java.io.FileNotFoundException(https://firebasestorage.googleapis.com/v0/b/agmhealing3.appspot.com/o?name=profile%2Filhot.jpg&uploadType=resumable&upload_id=AAANsUmoPKKUSR5zaL6S3LuQjiQPxMIKVo59yiIie3X_69GAuROJYDVObgoDnSRTHWDCeABoGBBtdGS_ZGCLJ-egsGM&upload_protocol=resumable) call GlideException#logRootCauses(String) for more detail Cause (1 of 1): class java.io.FileNotFoundException: https://firebasestorage.googleapis.com/v0/b/agmhealing3.appspot.com/o?name=profile%2Filhot.jpg&uploadType=resumable&upload_id=AAANsUmoPKKUSR5zaL6S3LuQjiQPxMIKVo59yiIie3X_69GAuROJYDVObgoDnSRTHWDCeABoGBBtdGS_ZGCLJ-egsGM&upload_protocol=resumable I/Glide: Root cause (1 of 1) java.io.FileNotFoundException: https://firebasestorage.googleapis.com/v0/b/agmhealing3.appspot.com/o?name=profile%2Filhot.jpg&uploadType=resumable&upload_id=AAANsUmoPKKUSR5zaL6S3LuQjiQPxMIKVo59yiIie3X_69GAuROJYDVObgoDnSRTHWDCeABoGBBtdGS_ZGCLJ-egsGM&upload_protocol=resumable at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:255) at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:211) at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:30) at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:102) at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:56) at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100) at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.startNextOrFail(MultiModelLoader.java:164) at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.onLoadFailed(MultiModelLoader.java:154) at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:62) at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100) at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70) at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63) at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:310) at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:279) at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:234) 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:923) at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393) |
* 프로필 이미지 변경을 위해서 안드로이드 에뮬레이터 갤러리에 프로필로 선택 할 수 있는 사진이 필요함
당연히 안드로이드 에뮬레이터에 업로드된 사진은 없는 상태
인터넷에서 CROP하는 방법을 찾다가, 테스트만 할 수 있게 꼼수로 파일을 넣었다
앱 만들기 강좌를 진행하는 것이 더 중요하니까
요정도 꼼수로 해보고 다음에 CROP으로 테스트 해 볼 것!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2020/08/02 - [경단녀에서 "나"로 돌아가기/안드로이드] - 안드로이드 에뮬레이터 갤러리에 사진 업로드 하는 방법(꼼수)
* Firebase Storage에 선택한 프로필 사진이 등록은 되지만
메뉴에 프로필 이미지가 변경되지 않는 상태
하지만 Firebase 스토리지에는 사진이 정상적으로 변경된다
------------------------------ ProfileActivity Save() addOnSuccessListener 에서 로그인 성공시, 프로필 URL을 가져오는 부분에 메소드가 틀림
--------------------- 기존에 강의에서는 getDownloadUrl를 사용하고 있지만 이미 사용되지 않는 메소드이고
---------------------- 대체된 메소드로 URL을 가져올 경우 Uri 객체에 담아야 하는데 방법을 모름
----------------------- 찾아볼 것!!!!!!!!!!!!!!!!
downUri를 받아 올 수 있게 하여
프로필 수정시, 변경된 사진으로 보이지만
다시 로그인 했을 때, 기본 사진과 닉네임으로 보임
* getDownloadUrl 즉, Uri를 받아오는 방식이 변경됨
기존 |
Uri downloadUrl = taskSnapshot.getDownloadUrl(); |
변경 |
mountainsRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() { @Override public void onSuccess(Uri downloadUrl) { ap.setProfileImage(downloadUrl.toString()); UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder() .setDisplayName(etNickname.getText().toString()) .setPhotoUri(downloadUrl) .build(); user.updateProfile(profileUpdates) .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { //성공 setResult(RESULT_OK); finish(); Toast.makeText(ProfileActivity.this, "정상적으로 수정 되었습니다.", Toast.LENGTH_SHORT).show(); }else{ Toast.makeText(ProfileActivity.this, "오류가 발생했습니다. 잠시후 다시 해보세요.", Toast.LENGTH_SHORT).show(); } pd.dismiss(); } }); } }); |
http://blog.naver.com/PostView.nhn?blogId=charlie0819&logNo=221945938406
https://gist.github.com/jonathanbcsouza/13929ab81077645f1033bf9ce45beaab#comments
https://firebase.google.com/docs/storage/android/upload-files?authuser=0
Uri downloadUrl = taskSnapshot.getUploadSessionUri();//getDownloadUrl
//Task<Uri> downloadUrl = taskSnapshot.getMetadata().getReference().getDownloadUrl();
//Uri downLoadUrl = (Uri)taskSnapshot.getMetadata().getReference().getDownloadUrl();
W/Glide: Load failed for https://firebasestorage.googleapis.com/v0/b/agmhealing3.appspot.com/o?name=profile%2Fmong.jpg&uploadType=resumable&upload_id=AAANsUlv9dS8W03NVChu4NUtGuD55mU7hWpYUALWfnvGwYUqdjiEMuk7RwV1iCoVADdjhpBurWfgRNxj53JK5kH4DM6cNBjgyg&upload_protocol=resumable with size [175x175]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 cause:
java.io.FileNotFoundException(https://firebasestorage.googleapis.com/v0/b/agmhealing3.appspot.com/o?name=profile%2Fmong.jpg&uploadType=resumable&upload_id=AAANsUlv9dS8W03NVChu4NUtGuD55mU7hWpYUALWfnvGwYUqdjiEMuk7RwV1iCoVADdjhpBurWfgRNxj53JK5kH4DM6cNBjgyg&upload_protocol=resumable)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE
There was 1 cause:
java.io.FileNotFoundException(https://firebasestorage.googleapis.com/v0/b/agmhealing3.appspot.com/o?name=profile%2Fmong.jpg&uploadType=resumable&upload_id=AAANsUlv9dS8W03NVChu4NUtGuD55mU7hWpYUALWfnvGwYUqdjiEMuk7RwV1iCoVADdjhpBurWfgRNxj53JK5kH4DM6cNBjgyg&upload_protocol=resumable)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
There was 1 cause:
java.io.FileNotFoundException(https://firebasestorage.googleapis.com/v0/b/agmhealing3.appspot.com/o?name=profile%2Fmong.jpg&uploadType=resumable&upload_id=AAANsUlv9dS8W03NVChu4NUtGuD55mU7hWpYUALWfnvGwYUqdjiEMuk7RwV1iCoVADdjhpBurWfgRNxj53JK5kH4DM6cNBjgyg&upload_protocol=resumable)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class java.io.FileNotFoundException: https://firebasestorage.googleapis.com/v0/b/agmhealing3.appspot.com/o?name=profile%2Fmong.jpg&uploadType=resumable&upload_id=AAANsUlv9dS8W03NVChu4NUtGuD55mU7hWpYUALWfnvGwYUqdjiEMuk7RwV1iCoVADdjhpBurWfgRNxj53JK5kH4DM6cNBjgyg&upload_protocol=resumable
I/Glide: Root cause (1 of 1)
java.io.FileNotFoundException: https://firebasestorage.googleapis.com/v0/b/agmhealing3.appspot.com/o?name=profile%2Fmong.jpg&uploadType=resumable&upload_id=AAANsUlv9dS8W03NVChu4NUtGuD55mU7hWpYUALWfnvGwYUqdjiEMuk7RwV1iCoVADdjhpBurWfgRNxj53JK5kH4DM6cNBjgyg&upload_protocol=resumable
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:255)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:211)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:30)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:102)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:56)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.startNextOrFail(MultiModelLoader.java:164)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.onLoadFailed(MultiModelLoader.java:154)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:62)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:310)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:279)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:234)
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:923)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
* 프로필과 닉네임을 수정해서 저장하는 것은 성공 했으나, 수정 후 사용자 정보에 저장된 내용을 변경하는 부분이 없었음
추가로 수정함. 소스 코드를 남겨 놓을 까 하다가 오틸라님이 공부하라고 남겨둔 여백인가 싶어서 생략한다
* 오틸라의 안드로이드 앱 만들기 강좌 : 힐링 #9
'경단녀에서 "나"로 돌아가기 > 안드로이드' 카테고리의 다른 글
안드로이드 에뮬레이터 갤러리에 사진 업로드 하는 방법(꼼수) (0) | 2020.08.02 |
---|---|
오늘도 안드로이드 스튜디오 새로 셋팅 했지롱 (0) | 2020.07.30 |
오틸라의 안드로이드 앱 만들기 강좌 : 힐링 #8 (0) | 2020.07.21 |
오틸라의 안드로이드 앱 만들기 강좌 : 힐링 #7 (0) | 2020.07.08 |
앱 개발은 언제하나요 나님 (0) | 2020.07.03 |