divine_rythm
divine_rythm

Reputation: 159

An unknown error occured please check HTTP result code and inner exception for server response

This picture is of the upload fragment made by me using android studio and when the list item is been clicked the object should be downloaded.It's Working fine and the object is been downloaded on my phone and the other phone on which I installed it. But when I shared this application to others it gives the error marked in the picture on their phones.Updating the play services is not removing the error.enter image description here

Upvotes: 3

Views: 6713

Answers (7)

Tamer Sabek
Tamer Sabek

Reputation: 1

I've just updated the implementation in the build.gradle(:app) to

implementation 'com.google.firebase:firebase-storage:20.0.1'

Upvotes: 0

cihatpala
cihatpala

Reputation: 21

I had the same issue and when I checked the Storage rules:

allow read, write: if false

I saw it was.

It worked when I changed it to:

allow read, write: if true

Upvotes: 0

Apurba A
Apurba A

Reputation: 158

After 3-4 hrs depression,i got the actual reason. While downloading,I need to give storage permission of writing but I only gave read permission. In lower androids , read-write permission is same.Basically I was used to/accustomed to these lower version devices that's why forget to add write storage permission for the upper androids

Upvotes: 0

Zain
Zain

Reputation: 40810

For me, I was providing invalid system file path while calling getFile() of the FileDownloadTask, I was initially trying to download a file from Firebase.

Here the issued is raised as the downloadDirectory was invalid

File localFile = ...;
FileDownloadTask downloadTask = FirebaseStorage.getInstance()
                                               .getReference()
                                               .child("fileName")
                                               .getFile(localFile);

Here the path of the localFile I was providing was invalid.

Upvotes: 0

Muhammad Arslan
Muhammad Arslan

Reputation: 1257

Sorry, I am late. but today I am also facing the same issue. What I've done is to update the storage library in build.Gradle (app) file. and it solved my problem. Basically when you configure storage using Android studio firebase assistant. This will import the older version of the app. So don't to update a newer version

Upvotes: 0

Ali Raza
Ali Raza

Reputation: 21

May be this is the wrong path bug but in my case resolve this here is the example

i use this code then i received error

public static StorageReference getChildProfileStorage(String vid){
    StorageReference storageReference= FirebaseStorage.getInstance().getReference();
    storageReference.child("ParentDataStore").child(CurrentUser.getInstance().getEmail())
            .child("ChildDataStore").child(vid);


    return storageReference;
}

here is the line that solve my problem

public static StorageReference getStudentProfileStorage(String vid){
    StorageReference storageReference= FirebaseStorage.getInstance().getReference("ParentDataStore")
            .child("StudentDataStore").child(vid).child("profile");
    return storageReference;
}

Upvotes: 2

divine_rythm
divine_rythm

Reputation: 159

After 2 days of frustration, I found out that there is a bug in firebase storage.Thus, you've to simply turn off and on your storage manually,thanks.

Upvotes: 3

Related Questions