I use Firebase Storage to upfile
. But it does not work
THIS IS MY CODE.
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference sto
There can be various reasons for this error, since it is not pointing out the reason. But things can be done. First update the storage library of firebase to latest version in gradle file. Second check permissions in android settings
Make sure you've connected to firebase. Open the firebase assistant, go to storage, click on upload and download a file from storage and check. Connecting is easy. Just click on the connect button.
update your firebase-storage dependency
implementation 'com.google.firebase:firebase-storage:17.0.0'
For me this error was triggered when uploading a 0.0 KB image file; that is because I was testing image compression algorithm that has a bug resulting in 0.0 KB image in some cases.
So, make sure that the image/file you upload is greater than 0 KB.
Add correct dependencies:
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.google.firebase:firebase-storage:17.0.0'
implementation 'com.google.firebase:firebase-database:17.0.0'
So the I had the same problem and I easily fixed it!, so this is not a problem with firebase, but the problem is that your file can not be accessed from your local disk!
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
for api 21+ you will need to request permission, for security reasons, check this article for more information: How to request storage permission