New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android Firebase 11.2.0 MetaData causing "StorageException, an unknown error has occured" #116
Comments
I realized I probably put this in the wrong location. Not really sure where to post I just saw someone else had an error that seemed similar a while back. |
Hi Mitch, In 11.0.4 and older versions of the Android SDK, there was a bug when setting the ContentLanguage. In 11.2.0, this bug was fixed and the SDK now correctly sends the content language to the server. We didn't realize at the time that fixing the bug would also lead to the server starting to reject invalid content languages or we would have documented it. In case someone else reads this: even though this is posted under "quickstart-unity", it is an issue with the Android Firebase Storage SDK. The restriction to ISO 639-1 language codes also exists in the Unity SDK, but there never was a change in behavior. |
That was fast. Thanks Patrick. |
Hello Mitch.. Please I really need a mentor showing me how to make android apps,please... And I'm having this error of StorageException -1300..I need help..Thank you so much |
hi patrick, i was also getting same error "StorageException has occurred. |
Same here I also trying store my file in Firebase Storage but it gives me this error when i run my app on my real device but it is working perfectly on Emulator i don't know how! I am using 11.0.4 version |
I tested with 11.0.4 and it works fine. 11.2.0 up to 11.4.0 cause the error. The error is at the bottom. There is a heading labeled "Error Message"
Here are the details:
Original code:
UploadTask uploadTask = storageReference.putBytes(mBytes, metadata);
Changed to:
UploadTask uploadTask = storageReference.putBytes(mBytes);
Hypothesis:
Whatever change was introduced regarding the meta data in 11.2.0 is causing an issue.
Relevant code:
My Storage reference:
StorageReference storageReference = FirebaseStorage.getInstance().getReference() .child("photos/users/" + FirebaseAuth.getInstance().getCurrentUser().getUid() + "/profile_image");
My Meta Data:
StorageMetadata metadata = new StorageMetadata.Builder() .setContentType("image/jpg") .setContentLanguage("English") .setCustomMetadata("Mitch's special meta data", "JK nothing special here") .setCustomMetadata("location", "Iceland") .build();
My UploadTask:
UploadTask uploadTask = storageReference.putBytes(mBytes, metadata);
Then OnSuccessListener and so on...
Error Message
StorageException has occurred. An unknown error occurred, please check the HTTP result code and inner exception for server response. Code: -13000 HttpResult: 400 09-30 12:44:06.048 31582-1094/courses.pluralsight.com.tabianconsulting E/StorageException: The server has terminated the upload session java.io.IOException: The server has terminated the upload session at com.google.firebase.storage.UploadTask.zzcat(Unknown Source) at com.google.firebase.storage.UploadTask.zzcas(Unknown Source) at com.google.firebase.storage.UploadTask.run(Unknown Source) at com.google.firebase.storage.zzs.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)
The text was updated successfully, but these errors were encountered: