Getting 'StorageException' even after setting my rules as public. Please see details
<p>I have stored some images on <code>Firebase</code> and when I am trying to download them, I'm getting following error: <code>E/StorageException: StorageException has occurred. User does not have permission to access this object. Code: -13021 HttpResult: 403</code>. I am using Google Authentication too.</p>

<p>Here's how I am uploading image:</p>

<pre><code>StorageReference storageReference = firebaseStorage.getReferenceFromUrl("gs://appname-e2a32.appspot.com").child("hImage");

UploadTask uploadTask = storageReference.putBytes(data);
uploadTask.addOnFailureListener(new OnFailureListener() {
    @Override
    public void onFailure(@NonNull Exception exception) {
        Toast.makeText(getBaseContext(), exception.getMessage(), Toast.LENGTH_SHORT).show();
        // Handle unsuccessful uploads
    }
}).addOnSuccessListener(new OnSuccessListener&lt;UploadTask.TaskSnapshot&gt;() {
    @Override
    public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
        // taskSnapshot.getMetadata() contains file metadata such as size, content-type, and download URL.
        Uri downloadUrl = taskSnapshot.getDownloadUrl();
        savingHelpRequest.dismiss();
        Toast.makeText(getBaseContext(), "image uploaded", Toast.LENGTH_SHORT).show();
    }
});
</code></pre>

<p>Here's how I am trying to download it:</p>

<pre><code>FirebaseStorage firebaseStorage = FirebaseStorage.getInstance();

storageReference = firebaseStorage.getReferenceFromUrl("gs://appname-e2a32.appspot.com").child("hImage");

storageReference.getBytes(Long.MAX_VALUE).addOnSuccessListener(new OnSuccessListener&lt;byte[]&gt;() {
    @Override
    public void onSuccess(byte[] bytes) {
        // Use the bytes to display the image
        ByteArrayOutputStream baoStream = new ByteArrayOutputStream();
        bytes = baoStream.toByteArray();
        bmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);

    }
    }).addOnFailureListener(new OnFailureListener() {
    @Override
    public void onFailure(@NonNull Exception exception) {
        // Handle any errors
        Toast.makeText(getBaseContext(), exception.getMessage(), Toast.LENGTH_LONG).show();
    }
});
</code></pre>

<p>Here's the security rules:</p>

<pre><code>service firebase.storage {
     match /b/appname-e2a32.appspot.com/o {
     match /{allPaths=**} {
     allow read, write;
    }
 }
}
</code></pre>

<p>Please let me know how can I get rid of this error and download the images successfully?</p>