Firebase Сервер завершил сеанс загрузки в мобильной сети - PullRequest
0 голосов
/ 21 декабря 2018

Firebase хранилище (загрузка изображений) работает только с WiFi сетью, я могу загрузить изображение и скачать то же самое.Однако загрузка не работает с мобильной сетью (LTE / 3G)

Java-код:

StorageReference storageRef = FirebaseStorage.getInstance().getReference();
        final StorageReference ref = storageRef.child("images/"+ mImagePath);
            ref.putFile(Uri.parse("file:///"+mImagePath),metadata)
               .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
                    public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
// do something

                    }
                })
                .addOnFailureListener(new OnFailureListener() {
                    @Override
                    public void onFailure(@NonNull Exception e) {

e.printStackTrace();

                })}

Исключение:

The server has terminated the upload session java.io.IOException: The server has terminated the upload session at com.google.firebase.storage.UploadTask.serverStateValid(com.google.firebase:firebase-storage@@16.0.4:320) at com.google.firebase.storage.UploadTask.shouldContinue(com.google.firebase:firebase-storage@@16.0.4:289) at com.google.firebase.storage.UploadTask.run(com.google.firebase:firebase-storage@@16.0.4:203) at com.google.firebase.storage.StorageTask.lambda$getRunnable$7(com.google.firebase:firebase-storage@@16.0.4:1106) at com.google.firebase.storage.StorageTask$$Lambda$12.run(com.google.firebase:firebase-storage@@16.0.4) 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) Caused by: java.io.IOException: { "error": { "code": 403, "message": "Permission denied. Could not perform this operation" }} at com.google.firebase.storage.network.NetworkRequest.parseResponse(com.google.firebase:firebase-storage@@16.0.4:455) at com.google.firebase.storage.network.NetworkRequest.parseErrorResponse(com.google.firebase:firebase-storage@@16.0.4:435) at com.google.firebase.storage.network.NetworkRequest.processResponseStream(com.google.firebase:firebase-storage@@16.0.4:426) at com.google.firebase.storage.network.NetworkRequest.performRequest(com.google.firebase:firebase-storage@@16.0.4:280) at com.google.firebase.storage.network.NetworkRequest.performRequest(com.google.firebase:firebase-storage@@16.0.4:294) at com.google.firebase.storage.internal.ExponentialBackoffSender.sendWithExponentialBackoff(com.google.firebase:firebase-storage@@16.0.4:65) at com.google.firebase.storage.internal.ExponentialBackoffSender.sendWithExponentialBackoff(com.google.firebase:firebase-storage@@16.0.4:57) at com.google.firebase.storage.UploadTask.sendWithRetry(com.google.firebase:firebase-storage@@16.0.4:457) at com.google.firebase.storage.UploadTask.beginResumableUpload(com.google.firebase:firebase-storage@@16.0.4:257) at com.google.firebase.storage.UploadTask.run(com.google.firebase:firebase-storage@@16.0.4:198) at com.google.firebase.storage.StorageTask.lambda$getRunnable$7(com.google.firebase:firebase-storage@@16.0.4:1106) at com.google.firebase.storage.StorageTask$$Lambda$12.run(com.google.firebase:firebase-storage@@16.0.4) 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)

Правила хранения:

    service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
  allow read, write: if request.auth != null;
  //allow read, write

}
}
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...